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
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).
robinst
changed the title
DocumentParser drops whitespaces at the beginning of a line
Preserve information about leading whitespace in paragraphs
Mar 23, 2025
When using
DocumentParser
with no enabled block types, theText
nodes do not include whitespaces at the beginning of a line.For example, when we use a parser with no enabled block types and the input is:
the expected result is a document containing two
Text
nodes:but the second
Text
is "- text 2" (without preceding whitespaces)To better illustrate here is a sample test that fails:
The text was updated successfully, but these errors were encountered: