markup/goldmark: Make auto IDs GitHub compatible

You can turn off this behaviour:

```toml
[markup]
  [markup.goldmark]
    [markup.goldmark.parser]
      autoHeadingIDAsciiOnly = true
```
Note that the `anchorize` now adapts its behaviour depending on the default Markdown handler.

Fixes #6616
This commit is contained in:
Bjørn Erik Pedersen
2020-01-04 11:28:19 +01:00
parent ae816452b1
commit a82d2700fc
12 changed files with 421 additions and 35 deletions

View File

@@ -69,6 +69,10 @@ type Parser struct {
// auto generated heading ids.
AutoHeadingID bool
// When AutoHeadingID is enabled this will generate IDs with Ascii
// characters only.
AutoHeadingIDAsciiOnly bool
// Enables custom attributes.
Attribute bool
}