Skip to content

keep trailing tab before a soft line break - #641

Open
zayeem06 wants to merge 1 commit into
commonmark:masterfrom
zayeem06:trailing-tab-softbreak
Open

zayeem06 wants to merge 1 commit into
commonmark:masterfrom
zayeem06:trailing-tab-softbreak

Conversation

@zayeem06

Copy link
Copy Markdown
Contributor

parse_inline strips trailing whitespace from a text run that ends at a line ending with cmark_chunk_rtrim, which also removes tabs. The spec removes only trailing spaces at the end of a line before a soft or hard line break, so a trailing tab should survive: foo\t\nbar renders as <p>foo\nbar</p> here but <p>foo\t\nbar</p> in commonmark.js 0.31.2 and per the spec (section "Soft line breaks": "Spaces at the end of the line ... are removed"). Strip only trailing spaces at that site; the paragraph-final trim and the ATX trailing-hashtag trim, which the spec does strip tabs from, are left alone.

This fix was found and prepared with AI assistance and reviewed by me before submitting.

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