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/goldmark_config/config.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/goldmark_config/config.go')
-rw-r--r-- | markup/goldmark/goldmark_config/config.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/markup/goldmark/goldmark_config/config.go b/markup/goldmark/goldmark_config/config.go index 2454eb46f..47399b52c 100644 --- a/markup/goldmark/goldmark_config/config.go +++ b/markup/goldmark/goldmark_config/config.go @@ -14,6 +14,11 @@ // Package goldmark_config holds Goldmark related configuration. package goldmark_config +const ( + AutoHeadingIDTypeGitHub = "github" + AutoHeadingIDTypeGitHubAscii = "github-ascii" +) + // DefaultConfig holds the default Goldmark configuration. var Default = Config{ Extensions: Extensions{ @@ -29,8 +34,9 @@ var Default = Config{ Unsafe: false, }, Parser: Parser{ - AutoHeadingID: true, - Attribute: true, + AutoHeadingID: true, + AutoHeadingIDType: AutoHeadingIDTypeGitHub, + Attribute: true, }, } @@ -69,9 +75,10 @@ type Parser struct { // auto generated heading ids. AutoHeadingID bool - // When AutoHeadingID is enabled this will generate IDs with Ascii - // characters only. - AutoHeadingIDAsciiOnly bool + // The strategy to use when generating heading IDs. + // Available options are "github", "github-ascii". + // Default is "github", which will create GitHub-compatible anchor names. + AutoHeadingIDType string // Enables custom attributes. Attribute bool |