You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 10, 2025. It is now read-only.
Fix removal of last key from map in block-mode when value is empty.
Fixes #55.
When the value is empty the `SourceSpan` for the `YamlNode` representing
the value in a map points to the colon.
Example:
```yaml
foo:
bar:
```
The `YamlNode` for `foo.bar` has a value of `null` and starts and ends
at the colon `:` following `bar`. This means that removal might leave
the colon behind, which causes invalid YAML.
We have the same issue when removing `foo.bar` from the following YAML
document:
```yaml
foo:
baz: true
bar:
```
However, in this case, we have a hack that ensures we always strip away
the any comments that follows `bar`. We do this by deleting up-to the
next newline. If we apply the same hack when removing `foo.bar` in the
first example, then it works.
One could argue that it works by accident, but it's kind of desired that
trailing comments are removed, when the value they are trailing is
removed.
0 commit comments