diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-11-06 20:10:47 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-11-23 14:12:24 +0100 |
commit | bfb9613a14ab2d93a4474e5486d22e52a9d5e2b3 (patch) | |
tree | 81c4dbd10505e952489e1dbcf1d7bafc88b57c28 /markup/markup_test.go | |
parent | a3fe5e5e35f311f22b6b4fc38abfcf64cd2c7d6f (diff) | |
download | hugo-bfb9613a14ab2d93a4474e5486d22e52a9d5e2b3.tar.gz hugo-bfb9613a14ab2d93a4474e5486d22e52a9d5e2b3.zip |
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
Diffstat (limited to 'markup/markup_test.go')
-rw-r--r-- | markup/markup_test.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/markup/markup_test.go b/markup/markup_test.go index c4c1ee032..669c0a446 100644 --- a/markup/markup_test.go +++ b/markup/markup_test.go @@ -29,13 +29,23 @@ func TestConverterRegistry(t *testing.T) { r, err := NewConverterProvider(converter.ProviderConfig{Cfg: viper.New()}) c.Assert(err, qt.IsNil) + c.Assert("goldmark", qt.Equals, r.GetMarkupConfig().DefaultMarkdownHandler) + + checkName := func(name string) { + p := r.Get(name) + c.Assert(p, qt.Not(qt.IsNil)) + c.Assert(p.Name(), qt.Equals, name) + } c.Assert(r.Get("foo"), qt.IsNil) - c.Assert(r.Get("markdown"), qt.Not(qt.IsNil)) - c.Assert(r.Get("mmark"), qt.Not(qt.IsNil)) - c.Assert(r.Get("asciidoc"), qt.Not(qt.IsNil)) - c.Assert(r.Get("rst"), qt.Not(qt.IsNil)) - c.Assert(r.Get("pandoc"), qt.Not(qt.IsNil)) - c.Assert(r.Get("org"), qt.Not(qt.IsNil)) + c.Assert(r.Get("markdown").Name(), qt.Equals, "goldmark") + + checkName("goldmark") + checkName("mmark") + checkName("asciidoc") + checkName("rst") + checkName("pandoc") + checkName("org") + checkName("blackfriday") } |