diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-05 11:29:22 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-05 11:29:22 +0100 |
commit | 8f071fc159ce9a0fc0ea14a73bde8f299bedd109 (patch) | |
tree | aee22932ccdfd1e4ed82e7c242f7f65f17eaf701 /markup/goldmark/convert.go | |
parent | 469351d5b6a1521069c8d82539476714df16a094 (diff) |
markup/goldmark: Make the autoID type config a string
To potentially make room for one more.
See #6707
Diffstat (limited to 'markup/goldmark/convert.go')
-rw-r--r-- | markup/goldmark/convert.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/markup/goldmark/convert.go b/markup/goldmark/convert.go index 7d50839e2..c6f958366 100644 --- a/markup/goldmark/convert.go +++ b/markup/goldmark/convert.go @@ -28,8 +28,8 @@ import ( "github.com/spf13/afero" "github.com/gohugoio/hugo/hugofs" - "github.com/gohugoio/hugo/markup/converter" + "github.com/gohugoio/hugo/markup/goldmark/goldmark_config" "github.com/gohugoio/hugo/markup/highlight" "github.com/gohugoio/hugo/markup/tableofcontents" "github.com/yuin/goldmark" @@ -57,7 +57,7 @@ func (p provide) New(cfg converter.ProviderConfig) (converter.Provider, error) { cfg: cfg, md: md, sanitizeAnchorName: func(s string) string { - return sanitizeAnchorNameString(s, cfg.MarkupConfig.Goldmark.Parser.AutoHeadingIDAsciiOnly) + return sanitizeAnchorNameString(s, cfg.MarkupConfig.Goldmark.Parser.AutoHeadingIDType == goldmark_config.AutoHeadingIDTypeGitHub) }, }, nil }), nil @@ -280,7 +280,7 @@ func (c *goldmarkConverter) Supports(feature identity.Identity) bool { } func (c *goldmarkConverter) newParserContext(rctx converter.RenderContext) *parserContext { - ctx := parser.NewContext(parser.WithIDs(newIDFactory(c.cfg.MarkupConfig.Goldmark.Parser.AutoHeadingIDAsciiOnly))) + ctx := parser.NewContext(parser.WithIDs(newIDFactory(c.cfg.MarkupConfig.Goldmark.Parser.AutoHeadingIDType))) ctx.Set(tocEnableKey, rctx.RenderTOC) return &parserContext{ Context: ctx, |