diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-06 20:10:47 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-23 14:12:24 +0100 |
commit | bfb9613a14ab2d93a4474e5486d22e52a9d5e2b3 (patch) | |
tree | 81c4dbd10505e952489e1dbcf1d7bafc88b57c28 /hugolib/shortcode_test.go | |
parent | a3fe5e5e35f311f22b6b4fc38abfcf64cd2c7d6f (diff) |
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 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index eb763b2a0..fdf37b6c2 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -44,6 +44,11 @@ func CheckShortCodeMatch(t *testing.T, input, expected string, withTemplate func func CheckShortCodeMatchAndError(t *testing.T, input, expected string, withTemplate func(templ tpl.TemplateHandler) error, expectError bool) { t.Helper() cfg, fs := newTestCfg() + + cfg.Set("markup", map[string]interface{}{ + "defaultMarkdownHandler": "blackfriday", // TODO(bep) + }) + c := qt.New(t) // Need some front matter, see https://github.com/gohugoio/hugo/issues/2337 @@ -584,6 +589,9 @@ title: "Foo" cfg.Set("pygmentsUseClasses", true) cfg.Set("pygmentsCodefences", true) + cfg.Set("markup", map[string]interface{}{ + "defaultMarkdownHandler": "blackfriday", // TODO(bep) + }) writeSourcesToSource(t, "content", fs, sources...) @@ -597,6 +605,7 @@ title: "Foo" th := newTestHelper(s.Cfg, s.Fs, t) expected := cast.ToStringSlice(test.expected) + th.assertFileContent(filepath.FromSlash(test.outFile), expected...) }) @@ -1245,6 +1254,9 @@ func TestShortcodeRef(t *testing.T) { v.Set("blackfriday", map[string]interface{}{ "plainIDAnchors": plainIDAnchors, }) + v.Set("markup", map[string]interface{}{ + "defaultMarkdownHandler": "blackfriday", // TODO(bep) + }) builder := newTestSitesBuilder(t).WithViper(v) |