mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
markup/goldmark: Support extras extension
Enables inclusion of these HTML elements in Markdown: - Inserted Text (++inserted++) - Mark Text (==marked==) - Subscript (H~2~O) - Superscript (1^st^)
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
b1bf0bff2c
commit
ca9a77ef92
@@ -17,6 +17,7 @@ package goldmark
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/gohugoio/hugo-goldmark-extensions/extras"
|
||||
"github.com/gohugoio/hugo-goldmark-extensions/passthrough"
|
||||
"github.com/gohugoio/hugo/markup/goldmark/hugocontext"
|
||||
"github.com/yuin/goldmark/util"
|
||||
@@ -113,6 +114,15 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
|
||||
|
||||
extensions = append(extensions, images.New(cfg.Parser.WrapStandAloneImageWithinParagraph))
|
||||
|
||||
extensions = append(extensions, extras.New(
|
||||
extras.Config{
|
||||
Insert: extras.InsertConfig{Enable: cfg.Extensions.Extras.Insert.Enable},
|
||||
Mark: extras.MarkConfig{Enable: cfg.Extensions.Extras.Mark.Enable},
|
||||
Subscript: extras.SubscriptConfig{Enable: cfg.Extensions.Extras.Subscript.Enable},
|
||||
Superscript: extras.SuperscriptConfig{Enable: cfg.Extensions.Extras.Superscript.Enable},
|
||||
},
|
||||
))
|
||||
|
||||
if mcfg.Highlight.CodeFences {
|
||||
extensions = append(extensions, codeblocks.New())
|
||||
}
|
||||
|
Reference in New Issue
Block a user