You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve information about leading whitespace in paragraphs #301
Not sure how we would handle it. We can't add the leading whitespace to the literal of Text nodes as that would change rendering for existing code, but maybe we could add it as another attribute.
Note that you should be able to work around this limitation by checking the source spans of the text (see includeSourceSpans on Parser.Builder).
changed the title [-]DocumentParser drops whitespaces at the beginning of a line[/-][+]Preserve information about leading whitespace in paragraphs[/+]on Mar 23, 2025
Activity
robinst commentedon Feb 8, 2024
The reason for this is the paragraph parser. The spec says that leading whitespace is skipped: https://spec.commonmark.org/0.31.2/#example-222
Not sure how we would handle it. We can't add the leading whitespace to the literal of
Textnodes as that would change rendering for existing code, but maybe we could add it as another attribute.Note that you should be able to work around this limitation by checking the source spans of the text (see
includeSourceSpansonParser.Builder).robinst commentedon Mar 9, 2024
See also #290 (comment)
[-]DocumentParser drops whitespaces at the beginning of a line[/-][+]Preserve information about leading whitespace in paragraphs[/+]