YamlDotNet
YamlDotNet copied to clipboard
Expose the indent for block scalar
Is your feature request related to a problem? Please describe.
We are leveraging this library to parse the YAML content written by our end-users. We need accurate location information of the source content. However, for the block scalar type, the node start and end information currently refer to the range of the entire property value, including the | or >, but not the value (indentation and block syntax are removed). This prevents us from obtaining accurate location information.
For example:
property: |
value
When we use the parser.Consume<NodeEvent>() to get the node after key, we get a Literal scalar type with the following property:
- Start.Line: 1
- Start.Column: 11
- End.Line: 3
- End Column: 1
- Value:
value\n
Describe the solution you'd like
We expected the removed indent to be visible on the scalar node as well so we can accurately report the location information if we need to address an issue with the value, such as:
- Indent: 2
Just to clarify that you’re thinking the values should represent the location of the letter v instead of the |