Skip to content

feat(parser): preserve soft line breaks as newlines in paragraphs#37

Merged
jmcollin merged 1 commit into
mainfrom
feat/soft-line-breaks
May 31, 2026
Merged

feat(parser): preserve soft line breaks as newlines in paragraphs#37
jmcollin merged 1 commit into
mainfrom
feat/soft-line-breaks

Conversation

@jmcollin

Copy link
Copy Markdown
Owner

Group soft-break tokens before inline parsing so delimiters like foo\nbar resolve correctly across line boundaries. Emit \n verbatim instead of space.

  • SoftBreakNode: new node type (direct AST construction support)
  • buildParagraphChildren(): join soft-break lines into one InlineParser call
  • HtmlRenderer: add SoftBreakNode arm → "\n"
  • Strip leading spaces (≤3 or tab) and trailing spaces from paragraph lines

Group soft-break tokens before inline parsing so delimiters like *foo\nbar*
resolve correctly across line boundaries. Emit \n verbatim instead of space.

- SoftBreakNode: new node type (direct AST construction support)
- buildParagraphChildren(): join soft-break lines into one InlineParser call
- HtmlRenderer: add SoftBreakNode arm → "\n"
- Strip leading spaces (≤3 or tab) and trailing spaces from paragraph lines
@jmcollin jmcollin self-assigned this May 31, 2026
@jmcollin jmcollin merged commit 6738cfb into main May 31, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant