Add Goldmark as the new default markdown handler

This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo.

If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration:

```toml
[markup]
defaultMarkdownHandler="blackfriday"
```

Fixes #5963
Fixes #1778
Fixes #6355
This commit is contained in:
Bjørn Erik Pedersen
2019-11-06 20:10:47 +01:00
parent a3fe5e5e35
commit bfb9613a14
69 changed files with 3424 additions and 1668 deletions

View File

@@ -25,20 +25,18 @@ import (
)
// Provider is the package entry point.
var Provider converter.NewProvider = provider{}
var Provider converter.ProviderProvider = provider{}
type provider struct {
}
func (p provider) New(cfg converter.ProviderConfig) (converter.Provider, error) {
var n converter.NewConverter = func(ctx converter.DocumentContext) (converter.Converter, error) {
return converter.NewProvider("rst", func(ctx converter.DocumentContext) (converter.Converter, error) {
return &rstConverter{
ctx: ctx,
cfg: cfg,
}, nil
}
return n, nil
}), nil
}
type rstConverter struct {