Expand description
Inline raw HTML recognizer per CommonMark §6.6 / Pandoc raw_html.
Matches a single HTML tag (open/close), comment, processing instruction,
declaration, or CDATA section starting at byte 0 of text. Returns the
length in bytes of the matched span, or None if the prefix doesn’t
parse.
The recognizer is intentionally byte-level and conservative: when a span
looks plausible but doesn’t fully close (e.g. unterminated comment or
quoted attribute), it returns None so the dispatcher falls back to
emitting plain text.
Backslash escapes and entity references inside the span are not
decoded — callers are expected to emit the bytes verbatim into the CST,
and the renderer must skip the standard text-token escaping for
INLINE_HTML nodes.
Functions§
- emit_
inline_ html - Emit a single
INLINE_HTMLnode holding the verbatim span. - try_
parse_ inline_ html - Try to match an inline raw HTML span starting at
text[0]. Returns the length in bytes consumed, orNoneif no match.