mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
committed by
Bjørn Erik Pedersen
parent
2dd608378d
commit
d0d2c6795e
@@ -19,6 +19,7 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/identity"
|
||||
|
||||
"github.com/gohugoio/hugo-goldmark-extensions/passthrough"
|
||||
"github.com/gohugoio/hugo/markup/goldmark/codeblocks"
|
||||
"github.com/gohugoio/hugo/markup/goldmark/goldmark_config"
|
||||
"github.com/gohugoio/hugo/markup/goldmark/images"
|
||||
@@ -154,6 +155,33 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
|
||||
extensions = append(extensions, c)
|
||||
}
|
||||
|
||||
if cfg.Extensions.Passthrough.Enable {
|
||||
configuredInlines := cfg.Extensions.Passthrough.Delimiters.Inline
|
||||
configuredBlocks := cfg.Extensions.Passthrough.Delimiters.Block
|
||||
|
||||
inlineDelimiters := make([]passthrough.Delimiters, len(configuredInlines))
|
||||
blockDelimiters := make([]passthrough.Delimiters, len(configuredBlocks))
|
||||
|
||||
for i, d := range configuredInlines {
|
||||
inlineDelimiters[i] = passthrough.Delimiters{
|
||||
Open: d[0],
|
||||
Close: d[1],
|
||||
}
|
||||
}
|
||||
|
||||
for i, d := range configuredBlocks {
|
||||
blockDelimiters[i] = passthrough.Delimiters{
|
||||
Open: d[0],
|
||||
Close: d[1],
|
||||
}
|
||||
}
|
||||
|
||||
extensions = append(extensions, passthrough.NewPassthroughWithDelimiters(
|
||||
inlineDelimiters,
|
||||
blockDelimiters,
|
||||
))
|
||||
}
|
||||
|
||||
if pcfg.Conf.EnableEmoji() {
|
||||
extensions = append(extensions, emoji.Emoji)
|
||||
}
|
||||
|
Reference in New Issue
Block a user