Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterCodeFenceMetadata ¶
FilterCodeFenceMetadata removes hidden or suspicious info strings from fenced code blocks.
Like FilterInvisibleCharacters this is copy-on-first-match: input whose lines all survive unchanged is returned without allocating.
func FilterHTMLTags ¶
FilterHTMLTags applies the HTML allowlist policy to input.
func FilterInvisibleCharacters ¶
FilterInvisibleCharacters removes invisible or control characters that should not appear in user-facing titles or bodies. This includes: - Unicode tag characters: U+E0001, U+E0020–U+E007F - BiDi control characters: U+202A–U+202E, U+2066–U+2069 - BiDi/directional marks: U+200E, U+200F, U+061C - Hidden modifier characters: U+200B, U+200C, U+00AD, U+FEFF, U+180E, U+2060–U+2064 - Orphaned variation selectors: U+FE00–U+FE0F, U+E0100–U+E01EF
Variation selectors are filtered contextually rather than unconditionally. A selector that forms a plausible variation sequence with the character it follows is preserved, so ordinary content such as "✈️", "1️⃣" and CJK ideographic variation sequences survive unchanged. Selectors that cannot belong to such a sequence — those at the start of the input, those following a removed or non-graphic character, and runs of consecutive selectors — are removed, which is the shape used to smuggle hidden payloads.
The scan is copy-on-first-match: clean input is returned unchanged with no allocation.
Types ¶
This section is empty.