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 /markup/blackfriday/renderer.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 'markup/blackfriday/renderer.go')
-rw-r--r-- | markup/blackfriday/renderer.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/markup/blackfriday/renderer.go b/markup/blackfriday/renderer.go index 9f4d44e02..a46e46b55 100644 --- a/markup/blackfriday/renderer.go +++ b/markup/blackfriday/renderer.go @@ -30,10 +30,9 @@ type hugoHTMLRenderer struct { // BlockCode renders a given text as a block of code. // Pygments is used if it is setup to handle code fences. func (r *hugoHTMLRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) { - if r.c.pygmentsCodeFences && (lang != "" || r.c.pygmentsCodeFencesGuessSyntax) { - opts := r.c.pygmentsOptions + if r.c.cfg.MarkupConfig.Highlight.CodeFences { str := strings.Trim(string(text), "\n\r") - highlighted, _ := r.c.cfg.Highlight(str, lang, opts) + highlighted, _ := r.c.cfg.Highlight(str, lang, "") out.WriteString(highlighted) } else { r.Renderer.BlockCode(out, text, lang) |