Skip to content

fix(markdown-toolkit): keep the line ending before an emptied last line of an inline template - #241

Merged
Jason3S merged 1 commit into
mainfrom
claude/md-inline-emptied-line
Nov 23, 2026
Merged

Jason3S merged 1 commit into
mainfrom
claude/md-inline-emptied-line

Conversation

@Jason3S

@Jason3S Jason3S commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

In an inline template, a line that an empty replacement leaves empty goes away with its own line ending. The last line has no line ending of its own, so until now the one before it went instead. Next to other text, that ran the two together:

md.p(md.inlineTemplate('a\n{@x@}', { x: '' }), 'b');
// before: ab
// after:  a
//         b      (the page shows "a b")

The line ending before an emptied last line now stays. The result matches the template written without the placeholder, 'a\n', whose line ending an inline template already keeps.

Block templates don't change: there, an emptied line still ends the paragraph.

…ne of an inline template

An emptied line now goes with its own line ending only. The last line has none, so the line ending before it stays, as it does when the template is written without the placeholder.
@Jason3S
Jason3S merged commit eb4eaa3 into main Nov 23, 2026
8 checks passed
@Jason3S
Jason3S deleted the claude/md-inline-emptied-line branch November 23, 2026 09:24
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