Add AutoHeadingID option to Markdown parser

This commit is contained in:
Luc Didry 2022-01-04 09:12:15 +01:00
parent e46a5cdf78
commit 73e6668d20
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C

View file

@ -15,6 +15,7 @@ import (
"github.com/jmoiron/sqlx/types"
"github.com/lib/pq"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/renderer/html"
null "gopkg.in/volatiletech/null.v6"
@ -261,6 +262,9 @@ type Bounce struct {
// markdown is a global instance of Markdown parser and renderer.
var markdown = goldmark.New(
goldmark.WithParserOptions(
parser.WithAutoHeadingID(),
),
goldmark.WithRendererOptions(
html.WithXHTML(),
html.WithUnsafe(),