Skip to content

fix: markdown — an indented fence inside a code block does not close it - #59

Merged
dskripchenko merged 1 commit into
mainfrom
fix/markdown-fence-indent
Oct 31, 2026
Merged

dskripchenko merged 1 commit into
mainfrom
fix/markdown-fence-indent

Conversation

@dskripchenko

Copy link
Copy Markdown
Owner

Found on a real README (embed's): an html block holding an HTML example with a `<script type="text/markdown">` inside, whose mermaid lines are indented. The renderer took the inner, indented ``` for the end of the outer block: the rest of the README rendered as a code block and its tables as text.

A closing fence now has to be the same character, at least as long, nothing after it, and indented at most three spaces more than the opening fence (CommonMark's rule, relative to the opening so fenced blocks inside list items still close). Same in splitMarkdown.

Test added; 1262 tests pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dskripchenko
dskripchenko merged commit 6d1bd25 into main Oct 31, 2026
2 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