fix: apply GFM tagfilter to raw HTML - #4068
Open
evgenyponomarev wants to merge 1 commit into
Open
Conversation
|
@evgenyponomarev 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.
|
Member
|
I feel like this may be a breaking change. Honestly I think this might be better as an extension. I don't think we have ever had any complaints that marked does not filter those html tags (I haven't actually checked). I know this follows the GMF spec but I don't think it follows most marked users expectations. |
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.
Marked version: master
Markdown flavor: GitHub Flavored Markdown
Description
Addresses the remaining tagfilter subgroup of #4050 (GFM 0.29 example 657).
When GFM is enabled, the default HTML renderer now replaces only the leading
<of the nine tag names defined by the GFM Disallowed Raw HTML extension. Matching is case-insensitive, supports opening and closing tags in inline or block HTML, and requires a complete tag-name boundary. Other HTML remains untouched, andgfm: falsepreserves the previous output.This is deliberately not a sanitizer; it implements only the narrow GFM tagfilter rule. The existing sanitization guidance remains applicable.
The GFM copy of the CommonMark fixtures now marks examples 170–173, 176, and 178 as intentional divergences because tagfilter changes their raw
script,textarea, andstyleoutput. The original CommonMark suite remains 44/44 for HTML blocks. This follows the existing convention used for CommonMark examples changed by the GFM autolink extension.AI disclosure: OpenAI Codex assisted with implementation and validation; I reviewed and own the contribution.
Contributor
Testing
npm test— 1,783 spec tests and 193 unit tests passed, plus UMD/CJS, types, package checks, and lint.npm run rulesnpm run build:resetCommitter
In most cases, this should be a different person than the contributor.