Skip to content

Incorrect SourceRange of multiline ListItem and BlockQuote #205

@gongzhang

Description

@gongzhang
let source = """
- foo
    bar
"""
let document = Document(parsing: source, options: [])
print(document.debugDescription())

Tree and SourceRange:

Document
└─ UnorderedList
   └─ ListItem
      └─ Paragraph (1:3..<2:8 ✅)
         ├─ Text "foo" (1:3..<1:6 ✅)
         ├─ SoftBreak
         └─ Text "bar" (2:3..<2:6 ❌)

Similar problems also occur with quote blocks. The source position of the leaf text node is incorrect when the indent is not aligned with the first line of the parent. This issue seems to trace back to cmark. Is there a quick workaround for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions