Documentation
¶
Overview ¶
Package markdown renders agent-authored markdown as sanitized HTML for the Seamless console. Agents write their durable knowledge -- memory, note, and task bodies, session findings, gardener digests -- in markdown; the console shows it. Render turns that markdown into safe template.HTML server-side (so the no-JS detail pages keep working), preserving the [[wiki-link]] cross-links that open the peek drawer. PlainText strips markdown for one-line previews.
Safety is layered: goldmark runs with raw inline/block HTML disabled (html.WithUnsafe is left OFF), and every rendered fragment then passes through a bluemonday UGC policy -- the real trust boundary -- so any HTML an agent embeds in a body is neutralized regardless of the parser's settings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlainText ¶
PlainText renders a markdown body to a single collapsed line of plain text: markdown syntax and [[wiki]] brackets are stripped and all whitespace is collapsed to single spaces. It is for clamped list previews, where formatting would only add noise. Wiki references render as their display text (alias or bare name), never as bare brackets.
func Render ¶
func Render(body string, resolve WikiResolver) template.HTML
Render turns an agent-authored markdown body into sanitized HTML. [[name]] references are resolved to peek links via resolve (nil disables wiki-linking); unresolved references stay as literal text. The result is safe to embed directly in a template.
Types ¶
type WikiResolver ¶
WikiResolver maps a normalized [[name]] reference to an href. ok=false leaves the reference as its literal "[[name]]" text. A nil resolver (passed to Render) disables wiki-linking entirely.