# Markdown pipeline (internal) S25 ships shithub's canonical markdown renderer. One package owns goldmark + bluemonday; every other package routes through `markdown.Render`. The boundary is enforced by `scripts/lint-markdown-boundary.sh`. ## Architecture ``` internal/markdown/ markdown.go — package doc + Ref/Mention public types version.go — Version int32 = 1 (pipeline stamp) opts.go — Options + Resolvers structs render.go — Render() entry point + RenderHTML shim sanitize.go — bluemonday policy markdown_test.go — XSS fixture suite + golden render tests extensions/ extensions.go — single ASTTransformer for refs/mentions/commits/emoji emoji.go — curated shortcode → unicode map ``` ## Render pipeline ``` source bytes │ ▼ [goldmark.Convert] CommonMark + GFM (tables, strikethrough, │ autolinks, task lists), html.WithUnsafe │ so raw HTML reaches the sanitizer │ ▼ [ASTTransformer] walks Document, skips code/codespan/link/ │ image/HTML subtrees, runs reCombined regex │ on each Text segment, replaces matches with │ Link nodes (mentions/refs/commits) or String │ nodes (emoji + plain-text fallbacks). │ ▼ [bluemonday.SanitizeBytes] strict UGC policy: scheme allowlist │ (http/https/mailto),
// │ //, language-* class on │ code, no