markup/goldmark: Make the autoID type config a string

To potentially make room for one more.

See #6707
This commit is contained in:
Bjørn Erik Pedersen
2020-01-05 11:29:22 +01:00
parent 469351d5b6
commit 8f071fc159
4 changed files with 22 additions and 11 deletions

View File

@@ -19,6 +19,8 @@ import (
"unicode"
"unicode/utf8"
"github.com/gohugoio/hugo/markup/goldmark/goldmark_config"
"github.com/gohugoio/hugo/common/text"
"github.com/yuin/goldmark/ast"
@@ -85,10 +87,10 @@ type idFactory struct {
vals map[string]struct{}
}
func newIDFactory(asciiOnly bool) *idFactory {
func newIDFactory(idType string) *idFactory {
return &idFactory{
vals: make(map[string]struct{}),
asciiOnly: asciiOnly,
asciiOnly: idType == goldmark_config.AutoHeadingIDTypeGitHubAscii,
}
}