The in-context marker codec v1 (spec-0016 ยง3), byte-identical to the
overlay's codec.js and the Astro add-on's encoder.
A marked text is OPEN + header + HEADER_END + text + CLOSE. The header is
the UTF-8 payload domain US key US locale (optionally RS argsJSON), each
byte written as four base-4 digits, most significant first. Every marker
codepoint is Default_Ignorable, so the text renders unchanged; they are
written here by number, never as literal invisible characters.
Summary
Functions
The CLOSE codepoint.
The four digit codepoints, values 0โ3.
The HEADER_END codepoint.
text wrapped in a marker for {domain, key, locale}. args_json, when
given, is recorded after U+001E in the header (it must be JSON, which never
holds a raw U+001E).
True when text holds a marker opening.
The OPEN codepoint.
Every well-formed marked segment of text, outer before inner, with its
clean text. Malformed headers and unbalanced CLOSEs are ignored; an OPEN
never closed extends to the end and is flagged open: true.
Everything that precedes the marked text: OPEN, the header digits, HEADER_END.
text without markers. Digit codepoints outside a header (a real ZWJ in
an emoji) are kept, like the overlay's stripMarks.
Types
Functions
The CLOSE codepoint.
The four digit codepoints, values 0โ3.
The HEADER_END codepoint.
text wrapped in a marker for {domain, key, locale}. args_json, when
given, is recorded after U+001E in the header (it must be JSON, which never
holds a raw U+001E).
True when text holds a marker opening.
The OPEN codepoint.
Every well-formed marked segment of text, outer before inner, with its
clean text. Malformed headers and unbalanced CLOSEs are ignored; an OPEN
never closed extends to the end and is flagged open: true.
Everything that precedes the marked text: OPEN, the header digits, HEADER_END.
text without markers. Digit codepoints outside a header (a real ZWJ in
an emoji) are kept, like the overlay's stripMarks.