mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
markdown: Pass emoji codes to yuin/goldmark-emoji
Removes emoji code conversion from the page and shortcode parsers. Emoji codes in markdown are now passed to Goldmark, where the goldmark-emoji extension converts them to decimal numeric character references. This disables emoji rendering for the alternate content formats: html, asciidoc, org, pandoc, and rst. Fixes #7332 Fixes #11587 Closes #11598
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/gohugoio/hugo/markup/converter"
|
||||
"github.com/gohugoio/hugo/markup/tableofcontents"
|
||||
"github.com/yuin/goldmark"
|
||||
emoji "github.com/yuin/goldmark-emoji"
|
||||
"github.com/yuin/goldmark/ast"
|
||||
"github.com/yuin/goldmark/extension"
|
||||
"github.com/yuin/goldmark/parser"
|
||||
@@ -149,6 +150,10 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
|
||||
extensions = append(extensions, c)
|
||||
}
|
||||
|
||||
if pcfg.Conf.EnableEmoji() {
|
||||
extensions = append(extensions, emoji.Emoji)
|
||||
}
|
||||
|
||||
if cfg.Parser.AutoHeadingID {
|
||||
parserOptions = append(parserOptions, parser.WithAutoHeadingID())
|
||||
}
|
||||
@@ -156,6 +161,7 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
|
||||
if cfg.Parser.Attribute.Title {
|
||||
parserOptions = append(parserOptions, parser.WithAttribute())
|
||||
}
|
||||
|
||||
if cfg.Parser.Attribute.Block {
|
||||
extensions = append(extensions, attributes.New())
|
||||
}
|
||||
|
Reference in New Issue
Block a user