Repository navigation
fix: recognize lowercase declarations as HTML blocks (CommonMark 4.6) - #1189
Merged
puzrin merged 1 commit intoJul 3, 2026
Conversation
Member
|
LGTM. Rebase please, conflicting with your another marged PR (samples landed to the same file) |
spokodev
force-pushed
the
w33/markdown-it-html-block-lowercase-declaration
branch
from
July 3, 2026 11:40
b454a5a to
214e458
Compare
Contributor
Author
|
Rebased onto master. The samples from #1188 and this PR now sit side by side in commonmark_extras.txt, and the full suite is green. |
meta-codesync Bot
pushed a commit
to meta/memlab
that referenced
this pull request
Sep 30, 2026
Summary: Bumps [[https://github.com/markdown-it/markdown-it | markdown-it]] from 14.3.0 to 14.3.2 in `website/`. **Changelog** (from [[https://github.com/markdown-it/markdown-it/blob/14.3.2/CHANGELOG.md | markdown-it's changelog]]): - **14.3.2** (2026-09-12), Security: backported 15.0.2 fixes. - **14.3.1** (2026-08-27), Security: backported 15.0.1 fixes. **Commits:** - [[markdown-it/markdown-it@efb9993 | efb9993]] 14.3.2 released - [[markdown-it/markdown-it@daf5a3c | daf5a3c]] Backported 15.0.2 fixes - [[markdown-it/markdown-it@a855f10 | a855f10]] 14.3.1 released - [[markdown-it/markdown-it@ad70f6b | ad70f6b]] Backported 15.0.1 fixes - [[markdown-it/markdown-it@b407f3b | b407f3b]] Ignore generated API docs in lint - [[markdown-it/markdown-it@bf025ad | bf025ad]] Prepare package.json for v14 backports - [[markdown-it/markdown-it@2d9bbea | 2d9bbea]] fix: recognize lowercase declarations as HTML blocks (CommonMark 4.6) ([[markdown-it/markdown-it#1189 | #1189]]) - [[markdown-it/markdown-it@a311cfb | a311cfb]] fix: keep literal backslash before space in link destination (CommonMark 6.3) - Full diff: [[markdown-it/markdown-it@14.3.0...14.3.2 | 14.3.0...14.3.2]] Only `website/yarn.lock` changes. Pull Request resolved: #156 Differential Revision: D122444745 Pulled By: JacksonGL fbshipit-source-id: e5a4d891b3431785279f5101f22490d6346c64be
This was referenced Oct 17, 2026
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.
CommonMark start condition 4 for HTML blocks (spec 4.6) says a block begins with
<!followed by an ASCII letter. ASCII letter means both cases, [A-Za-z].The block rule in lib/rules_block/html_block.mjs matches only [A-Z], so a line
like
is not recognized as an HTML block. Instead the declaration is pulled into the
preceding paragraph as inline HTML:
The spec-correct output, and the output of the reference commonmark.js renderer,
is:
because an HTML block of type 4 interrupts a paragraph.
The inline HTML rule already uses the correct range: lib/common/html_re.mjs has
const declaration = '<![A-Za-z][^>]*>'. This change makes the block rule matchthe same range, so uppercase and lowercase declarations behave the same.
Change:
/^<![A-Z]/becomes/^<![A-Za-z]/.Added a fixture in test/fixtures/markdown-it/commonmark_extras.txt covering a
lowercase declaration interrupting a paragraph.
All 652 CommonMark spec examples and the full markdown-it suite pass.