Skip to content

[GFM] Implement the tagfilter extension - #212

Merged
Ilia Permiashkin (p3rmiashkin) merged 1 commit into
JetBrains:masterfrom
LouisLou2:feat/gfm-tagfilter
Aug 18, 2026
Merged

[GFM] Implement the tagfilter extension#212
Ilia Permiashkin (p3rmiashkin) merged 1 commit into
JetBrains:masterfrom
LouisLou2:feat/gfm-tagfilter

Conversation

@LouisLou2

Copy link
Copy Markdown
Contributor

Summary

Implement the GFM tagfilter extension for raw HTML rendering.

The extension replaces the leading < with &lt; for the following tags, matched case-insensitively:

  • title
  • textarea
  • style
  • xmp
  • iframe
  • noembed
  • noframes
  • script
  • plaintext

Both inline HTML and HTML blocks are covered. Other HTML tags and CommonMark rendering remain unchanged.

This also tightens the type 7 HTML block start condition: after a complete opening or closing tag, only whitespace may appear before the end of the line. The previous condition incorrectly classified lines such as <strong> <title> as HTML blocks.

Closes #211

Tests

Added coverage for:

  • the official GFM tagfilter example
  • inline and block HTML
  • opening, closing, and self-closing tags
  • attributes and case-insensitive matching
  • allowed HTML tags
  • similar tag names such as <scripture>
  • unchanged CommonMark behavior

Existing GFM HTML block expectations were updated because GFMFlavourDescriptor enables GFM extensions globally.

Verification

  • ./gradlew jvmTest
  • ./gradlew jsNodeTest

Closes #ISSUE_NUMBER

@p3rmiashkin

Copy link
Copy Markdown
Contributor

Leo (@LouisLou2) Hi! Can you please rebase your branch on the latest master and add a note to CHANGELOG.md?

@LouisLou2

Copy link
Copy Markdown
Contributor Author

Leo (Leo (@LouisLou2)) Hi! Can you please rebase your branch on the latest master and add a note to CHANGELOG.md?

Done! I've rebased the branch onto the latest master and added a changelog entry under Unreleased.

@p3rmiashkin
Ilia Permiashkin (p3rmiashkin) merged commit a9269a4 into JetBrains:master Aug 18, 2026
3 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.

[GFM] Implement the tagfilter (Disallowed Raw HTML) extension

2 participants