Documentation
¶
Overview ¶
Package markdown is the Go-side implementation of the chain/markdown gno stdlib. See markdown.gno for the public contract.
Index ¶
- func CodeFence(content string, minCount int) string
- func EscapeBlockHazards(s string) string
- func EscapeBlockHazardsRich(s string) string
- func EscapeInline(s string) string
- func EscapeTitle(s string) string
- func MatchCharsetN(s string, firstLo, firstHi, restLo, restHi uint64, minLen, maxLen int) bool
- func MaxForeignBlocksPerConvert() int
- func NormalizeBreaks(s string) string
- func PercentEncodeURL(s string) string
- func StripBidiAndZeroWidth(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeBlockHazards ¶
EscapeBlockHazards is the strict variant (used by sanitize.Block). All doc-spoof, setext, and GFM-table-row defenses are on.
func EscapeBlockHazardsRich ¶
EscapeBlockHazardsRich is the permissive variant (used by sanitize.BlockRich). Line-leader (#, >, list markers, thematic breaks), setext-underline, and GFM table-row `|` escapes are all skipped — the user can compose multi-section markdown structure including tables. Realm-binding defenses (bracket walker, <gno-…> extension delimiters, CM §4.6 HTML block types 1-5 openers, fenced-code-block state machine, U+2028/U+2029/U+0085 fold) stay on — these are mode-independent security defenses, not stylistic preferences. NUL→U+FFFD replacement and bidi/zero-width strip run at the Gno layer (sanitize.BlockRich) before reaching this native, not here.
Cross-paragraph promotion (user `===`/`---` setext or `|---|---|` table-separator at start or end of input reaching into adjacent realm chrome) is neutralized at the Gno layer by sanitize.BlockRich emitting `\n\n` (CM blank line, i.e. paragraph break) on BOTH sides of the user content — symmetric isolation against backward and forward attacks.
func EscapeInline ¶
func EscapeTitle ¶
func MatchCharsetN ¶
func MaxForeignBlocksPerConvert ¶
func MaxForeignBlocksPerConvert() int
MaxForeignBlocksPerConvert returns maxForeignBlocksPerConvert. It backs the gno native of the same name (callable from realms) and is also the Go accessor the gnoweb foreign renderer uses.
func NormalizeBreaks ¶
func PercentEncodeURL ¶
func StripBidiAndZeroWidth ¶
Types ¶
This section is empty.