Skip to content

Commit

Permalink
Merge pull request #646 from ldidry/add-autoheadingid-option-to-markd…
Browse files Browse the repository at this point in the history
…own-parser

Add AutoHeadingID option to Markdown parser
  • Loading branch information
knadh committed Jan 4, 2022
2 parents e46a5cd + 73e6668 commit d42c676
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/models.go
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 d42c676

Please sign in to comment.