Repository navigation
Conversation
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
|
@hakarrr is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
|
Merged master into this branch (7da52e9) to resolve a conflict in |
| @@ -0,0 +1,80 @@ | |||
| --- | |||
| gfm: false | |||
There was a problem hiding this comment.
If this doesn't change between GFM and CommonMark we don't need to test both. Ideally we should have the least amount of tests that verify that the fix is working.
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
UziTech
left a comment
There was a problem hiding this comment.
Thanks for working on this! A few issues need to be addressed before this can be merged:
-
Benchmark &
recheckregression (src/rules.ts):
Expanding every ASCII letter in_tagandspecialTaginto[aA]character classes viacaseInsensitiveTaginflates the hot-path block regexes (paragraph,blockGfm.paragraph,lheading,lheadingGfm,gfmTable, andblockquote), causing:- A consistent +4–5 percentage-point regression in
npm run benchvsmaster(median across 3 interleaved runs:master4906 ms / 27% slower thancommonmarkvs PR 5043 ms / 32% slower thancommonmark). node test/recheck.tsregressing fromsafeonmastertotimeoutonblock.normal.blockquoteandblock.normal.lheading.
Since every other sub-pattern in
paragraph,lheading,blockquote, andgfmTableis case-invariant (andblock.normal.htmlalready compiles with'i'), please consider using the/iflag (or another approach that avoids[aA]expansion) sonpm run benchmatchesmasterandrecheckremainssafe. - A consistent +4–5 percentage-point regression in
-
GFM-noncompliant test assertions (
test/specs/new/table_html_interrupt_case.{md,html}):
Standalone<SPAN>and<META>are Type-7 HTML blocks and do terminate tables in GitHub GFM (cmark-gfm), so asserting they remain inside<tbody>locks in non-GFM behavior. Please update those negative-control rows to non-Type-7 inline HTML (e.g.,<SPAN> xand<META> x) or remove them. -
Inconsistent
metahandling & pedantic duplication (src/rules.ts):- Stripping
|metaonly insidecreateHtmlInterrupt(true)leavesmetain_tag,block.normal.html, andother.htmlBeginRegex(which mirrors paragraph interruption for lists). Removingmetadirectly from_tag(if all spec tests pass) would keep paragraph, list, and HTML block handling consistent. - Keeping separate
_htmlInterruptPedantic,lheadingPedantic, andcreateBlockquotefactories adds complexity and bundle size just to preserve accidental case-sensitivity in pedantic mode, even though OriginalMarkdown.pldoes not match Marked's legacy> a\n<SCRIPT>blockquote split. Also note that<SCRIPT>inhtml_interrupt_case_pedantic.mdtriggers HTTP 403 on the Daring Fireball Dingus WAF if the pedantic fixture is kept.
- Stripping
d9c1591 to
8aa9e29
Compare
Marked version: master, c6b22e8
Markdown flavor: CommonMark / GitHub Flavored Markdown
Description
The shared HTML interruption lookahead matches tag names only in lowercase. For example:
Expectation
The uppercase block tag interrupts the paragraph, just as
<div>does. The remaining lines stay raw HTML, not a heading. HTML block start conditions 1 and 6 match tag names without case sensitivity.CommonMark demo
Result
Marked currently makes the paragraph and uppercase tag into a setext heading. Uppercase block tags can also fail to end a paragraph, a lazy blockquote paragraph, or a GFM table.
Marked master demo
What was attempted
Expand only ASCII letters in the interruption lookahead's tag names into explicit case pairs. Keep the
<![CDATA[marker case-sensitive. Also excludemetafrom this interruption lookahead: it is a type-7 tag, not one of the type-6 block tag names. Arbitrary inline tags still cannot interrupt a paragraph. Build the legacy lookaheads separately for pedantic mode so its grammar stays unchanged.The fixtures cover mixed-case block tags, raw-text tags, closing tags, tag-name boundaries, inline-tag and
metacontrols, CDATA controls, GFM tables, and retained pedantic behavior.Validation on the final patch:
npm test: 2,043 spec tests and 256 unit tests passed, plus UMD, CJS, type, and lint checks.npm run build:resetgit diff --checkContributor
Committer
In most cases, this should be a different person than the contributor.