Documentation
¶
Overview ¶
Package format converts Markdown to HTML using Goldmark, adapted from mautrix-go/format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Extensions enables Strikethrough (~~text~~) and Table rendering. Extensions = goldmark.WithExtensions(extension.Strikethrough, extension.Table) // RendererOptions enables HardWraps (newlines become <br>) and Unsafe (raw HTML passthrough). RendererOptions = goldmark.WithRendererOptions(html.WithHardWraps(), html.WithUnsafe()) // ParserOptions registers LinksTransformer at priority 1000, ahead of other AST transformations. ParserOptions = goldmark.WithParserOptions(parser.WithASTTransformers(util.Prioritized(&LinksTransformer{}, 1000))) // Renderer is the package-level Goldmark renderer, safe for concurrent use; replace it to customize rendering. Renderer = goldmark.New(Extensions, RendererOptions, ParserOptions) )
Functions ¶
Types ¶
type LinksTransformer ¶
type LinksTransformer struct{}
LinksTransformer is a goldmark AST transformer that adds target="_blank" to every link node.
Click to show internal directories.
Click to hide internal directories.