summaryrefslogtreecommitdiffstats
path: root/markup/goldmark/convert.go
diff options
context:
space:
mode:
authorJoe Mooring <joe@mooring.com>2023-10-24 03:04:13 -0700
committerGitHub <noreply@github.com>2023-10-24 12:04:13 +0200
commit272484f8bfab97dbadad49a638a3e4b6af499f15 (patch)
tree39853fd0d9a1c7e28372777e0924497cc26607b2 /markup/goldmark/convert.go
parentde4e466036026e9a5805155f00882b93267231b5 (diff)
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
Diffstat (limited to 'markup/goldmark/convert.go')
-rw-r--r--markup/goldmark/convert.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/markup/goldmark/convert.go b/markup/goldmark/convert.go
index fa2ab548b..d66687783 100644
--- a/markup/goldmark/convert.go
+++ b/markup/goldmark/convert.go
@@ -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())
}