Documentation
¶
Overview ¶
Package render turns user-uploaded source into safe-to-serve HTML. Each renderer is a pure function: source bytes in, HTML bytes out. No I/O, no caching, no global state.
Not on the production serve path (the serve surface renders client-side); used by the render-md tool and the markdown memory benchmark.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Markdown ¶
Markdown renders source markdown into a self-contained sanitized HTML document: a complete <!doctype html> page with inline default styling, ready to serve as-is.
goldmark parses with GFM extensions and unsafe HTML PRESERVED, then bluemonday's UGCPolicy strips the dangerous tags and attributes (`<script>`, `javascript:` URLs, `onclick=`, dangerous form actions) from the intermediate HTML. That order is what lets inline HTML the user wrote survive parsing and still be sanitized. The wrapper template is server-controlled and trusted; only the body is user content.
Types ¶
This section is empty.