From 73e6668d20620b1038822d41d636380ab5e98af0 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Tue, 4 Jan 2022 09:12:15 +0100 Subject: [PATCH] Add AutoHeadingID option to Markdown parser --- models/models.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/models.go b/models/models.go index a9f3f65bd..40b93096c 100644 --- a/models/models.go +++ b/models/models.go @@ -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(),