Skip to content

Commit

Permalink
Add AutoHeadingID option to Markdown parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ldidry committed Jan 4, 2022
1 parent e46a5cd commit 73e6668
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 73e6668

Please sign in to comment.