markdown

package
v0.11.21 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer wraps goldmark for Markdown→HTML conversion.

func NewRenderer

func NewRenderer(cfg *config.MarkupConfig) *Renderer

NewRenderer creates a goldmark-based Markdown renderer from config. Heading IDs (anchor links) are enabled by default to match Hugo's behavior. Fenced code blocks are syntax-highlighted using chroma (matching Hugo's output).

func (*Renderer) Render

func (r *Renderer) Render(src string) (string, error)

Render converts Markdown source to HTML. After goldmark rendering, post-processors:

  • rewrite heading IDs to match Hugo's behavior (preserving CJK characters instead of falling back to "heading")
  • normalize HTML entities in inline-code to numeric form (fenced code blocks already use chroma which emits numeric entities natively)

Jump to

Keyboard shortcuts

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