markdown

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package markdown renders Markdown to sanitized HTML (goldmark GFM + bluemonday). It is the importable, canonical Markdown renderer for GoatFlow and its plugins — the same goldmark-GFM + bluemonday stack callers previously had to duplicate in an internal (unimportable) package or plugin-local shim.

GFM extensions (tables, strikethrough, autolinks, task lists) are enabled and from-attribute parsing is allowed. Raw/unsafe HTML in the source is stripped by bluemonday, so the returned HTML is safe to insert server-side into any page or plugin UI. Class attributes are preserved on common block/inline elements so an outer layer (e.g. Tailwind class injection) can restyle the output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(markdown string) string

Render converts Markdown to sanitized HTML. It returns "" for empty input and a sanitized fallback (the raw input with unsafe HTML stripped) if a single conversion fails, so a malformed document degrades to its literal text rather than a partial render.

Types

This section is empty.

Jump to

Keyboard shortcuts

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