cmark icon indicating copy to clipboard operation
cmark copied to clipboard

incorrect start_column & end_column

Open Parth opened this issue 3 years ago • 2 comments

The text: - \na

Creates the following hierarchy:

  • Document
    • List
      • Paragraph
        • Text

This AST has the following {start_line, end_line, start_column, end_column}

  • Document: {1, 2, 1, 1}
    • List: {1, 2, 1, 1}
      • Paragraph: {1, 2, 3, 1}
        • Text: {2, 2, 3, 3}

{2, 2, 3, 3} (the Text bounds) exceed the bounds for the document, and violates some assumptions which cause my application to panic.

I couldn't find any documentation which makes it clear whether this is a bug or not, but my intuition says that this is a bug.

Parth avatar Mar 23 '22 20:03 Parth

I agree, looks like a bug. I didn't write the code for inline source positions, but you should probably look at make_literal in inlines.c.

jgm avatar Mar 24 '22 00:03 jgm