Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect SourceRange of multiline ListItem and BlockQuote #205

Open
gongzhang opened this issue Nov 6, 2024 · 0 comments
Open

Incorrect SourceRange of multiline ListItem and BlockQuote #205

gongzhang opened this issue Nov 6, 2024 · 0 comments

Comments

@gongzhang
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant