Yams icon indicating copy to clipboard operation
Yams copied to clipboard

Error parsing markdown "code" backticks at end of line

Open br-tyler-milner opened this issue 3 years ago • 0 comments

I'm working on parsing an OpenAPI spec that I've written in YAML and noticed that this library is having trouble parsing markdown "code" formatting (using inline backticks) that I'm using in one of my descriptions.

This is the error I'm running into:

error: scanner: while scanning for the next token in line 60, column 1
found character that cannot start any token:
`
^

And this is an excerpt of the problematic YAML:

        details:
          type: string
          description: >-
            The details for this pet, if available.
            In some cases, the value of this
            property may include newline `\n`
            characters so that the content can be
            spread over multiple lines.
          example: pet details

As you can see, the `\n` at the end of one of the lines seems to be causing the problem and throwing the error in scanner.c. Unfortunately, I'm a bit rusty on my C so I'm not able to provide a fix right now, but I did want to go ahead and log this issue. As far as I can tell, this should be valid YAML. I've attached a sample project to this issue that demonstrates this problem.

yams-demo.zip

br-tyler-milner avatar Feb 10 '22 21:02 br-tyler-milner