Skip to content

Add raw HTML blocks to the markdown parser - #33

Merged
noha merged 1 commit into
masterfrom
feature/raw-html-block
Sep 11, 2026
Merged

noha merged 1 commit into
masterfrom
feature/raw-html-block

Conversation

@noha

@noha noha commented Sep 11, 2026

Copy link
Copy Markdown
Owner

A line starting with '<' followed by a letter, '/' or '!' now opens a raw HTML block that runs verbatim until the next blank line (or end of input). The lines are neither inline-parsed nor escaped when rendered, so authors can embed elements the markdown syntax has no notation for, e.g. an iframe. Previously such a line fell through to consumeParagraph: and came out as escaped tag soup.

Follows the existing four-part shape: #htmlBlock classification in FOLineClassifier (checked after the indented-code rule, so indented tags stay code), consumeHTMLBlock: in FOMarkdownParser, the FORawHTMLBlock node, and visitRawHTMLBlock: on both visitors (HTML: unchanged string, plain text: '').

No tag whitelist, no tag balancing, no inline HTML inside paragraphs; a '<' followed by a space or digit (as in '5 < 3') is still paragraph text.

A line starting with '<' followed by a letter, '/' or '!' now opens a raw HTML
block that runs verbatim until the next blank line (or end of input). The lines
are neither inline-parsed nor escaped when rendered, so authors can embed
elements the markdown syntax has no notation for, e.g. an iframe. Previously
such a line fell through to consumeParagraph: and came out as escaped tag soup.

Follows the existing four-part shape: #htmlBlock classification in
FOLineClassifier (checked after the indented-code rule, so indented tags stay
code), consumeHTMLBlock: in FOMarkdownParser, the FORawHTMLBlock node, and
visitRawHTMLBlock: on both visitors (HTML: unchanged string, plain text: '').

No tag whitelist, no tag balancing, no inline HTML inside paragraphs; a '<'
followed by a space or digit (as in '5 < 3') is still paragraph text.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noha
noha merged commit 1629968 into master Sep 11, 2026
4 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.

1 participant