render

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Markdown(src []byte) ([]byte, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL