YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

Scanner with SkipComments = false doesn't work

Open bryanbcook opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug Looks like a possible regression of #260

To Reproduce

var content = @"
        key1: value1
        key2: value2
        key3:
          key4: value4
          key5: value5
        key6:
          - item1
          - item2
          - item3

        # comment
        key7:
          - key8: value8
            key9: value9
            key10: value10
          - key11: key11
            key12:
              key13: value13
              key14: value14";

var yamlStream = new YamlStream();
var textReader = new StringReader(content);
var scanner = new Scanner(textReader, skipComments: false);
var parser = new Parser(scanner);
yamlStream.Load(parser);

throws an ArgumentException. Stack trace points to here

Please suggest a workaround if I'm going about this the wrong way.

bryanbcook avatar Oct 29 '24 22:10 bryanbcook

Also running into this issue, parsing mkdocs YML with comments. Exception in NodeValueDeserializer, after no deserializes are found in list

Image

MarkusWiedenmaier avatar Feb 16 '25 17:02 MarkusWiedenmaier