Repository navigation
🐛 FIX: deflist: keep indented : lines as lazy paragraph continuations - #182
Open
Asimmirzac wants to merge 1 commit into
Open
Asimmirzac wants to merge 1 commit into
Asimmirzac wants to merge 1 commit into
Conversation
Inside a definition, a line such as ` : text` that is indented at
least as far as the definition content ended the paragraph, because the
deflist rule accepted it as a paragraph terminator. The line was then
rendered as a separate paragraph and, in tight lists, glued to the
previous line without a line break.
Port upstream markdown-it-deflist commit 694a9e9 ("Correct lazy
paragraph continuations"), which only lets a marker terminate the
paragraph when it is indented less than the definition content, and
add its test fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inside a definition, a line that starts with
:or~but is indented at least as far as the definition content should be a lazy continuation of the paragraph. The deflist rule still accepted it as a paragraph terminator, so the paragraph was cut and the line became its own paragraph. In tight lists the two paragraphs are hidden, so the text was joined without the line break.Before:
After (same as markdown-it + markdown-it-deflist 3.0.1):
The fix ports upstream markdown-it-deflist commit 694a9e9 ("Correct lazy paragraph continuations"). In validation mode a marker line only ends the paragraph when it is indented less than the definition content. I also noted the commit in
port.yaml.Tests: added the two upstream fixtures plus the case above to
tests/fixtures/deflist.md. Two of them fail without the change, and the third (a marker in a blockquote that should not become a definition) passes with and without it.pytest: 733 passed, 3 skipped, 1 xfailedruff check,ruff format --check,mypy mdit_py_plugins: cleanjs-defaultpreset). Two of them differed before this change and none differ after it.I did not run
toxorpre-committhemselves, only the tools above directly (Python 3.12).Prepared with AI assistance (Claude Code).
🤖 Generated with Claude Code