Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Raw-HTML.md

FEATURE: Raw HTML

FieldValue
Version20261014 V1
DescriptionParse raw inline HTML tags, comments, processing instructions, declarations and CDATA sections and pass them through unescaped.
Depends OnFEATURE-Block-Engine.md
Providesraw inline HTML construct
Consumesinline parser hook

Purpose

Implement the Raw HTML section of the spec.

Grammar

Rules

Reads

Writes

Programmatic Acceptance

One corpus example in this section needs block quotes. The Raw HTML section is gated in the tabs story, so the checks here are bounded.

=== AC rawhtml-open-and-close-tags ===
Intent: Valid open, self-closing and closing tags in a paragraph pass through verbatim.

import subprocess

tags = '<a><bab><c2c> <a href="x" data-k=v /> </a></foo >' result = subprocess.run(["./commonmark"], input="Foo " + tags + "\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert tags in result.stdout === END AC rawhtml-open-and-close-tags ===

=== AC rawhtml-comment-pi-declaration-cdata ===
Intent: Inline comments, processing instructions, declarations and CDATA pass through verbatim.

import subprocess

for fragment in ["<!-- a comment -->", "<?php echo $a; ?>", "<!ELEMENT br EMPTY>", "<![CDATA[>&<]]>"]: result = subprocess.run(["./commonmark"], input="foo " + fragment + " bar\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert fragment in result.stdout === END AC rawhtml-comment-pi-declaration-cdata ===

=== AC rawhtml-illegal-forms-escaped ===
Intent: Illegal tag names are not raw HTML, so only the paragraph tags contribute angle brackets.

import subprocess

result = subprocess.run(["./commonmark"], input="<33> <__>\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<") == 2 assert result.stdout.count(">") == 2 === END AC rawhtml-illegal-forms-escaped ===

=== AC rawhtml-closing-tag-with-attributes ===
Intent: A closing tag with attributes is not raw HTML, so no extra angle brackets appear in the output.

import subprocess

result = subprocess.run(["./commonmark"], input='</a href="foo">\n', capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<") == 2 === END AC rawhtml-closing-tag-with-attributes ===

=== AC rawhtml-backslash-inert ===
Intent: A backslash inside a tag attribute value is preserved and not treated as an escape.

import subprocess

tag = '<a href="\\*">' result = subprocess.run(["./commonmark"], input="foo " + tag + "\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert tag in result.stdout === END AC rawhtml-backslash-inert ===

User Acceptance

Guardrails