mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +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:
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
func BenchmarkParse(b *testing.B) {
|
||||
start := `
|
||||
|
||||
|
||||
|
||||
---
|
||||
title: "Front Matters"
|
||||
@@ -38,33 +38,7 @@ This is some summary. This is some summary. This is some summary. This is some s
|
||||
|
||||
`
|
||||
input := []byte(start + strings.Repeat(strings.Repeat("this is text", 30)+"{{< myshortcode >}}This is some inner content.{{< /myshortcode >}}", 10))
|
||||
cfg := Config{EnableEmoji: false}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if _, err := parseBytes(input, cfg, lexIntroSection); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParseWithEmoji(b *testing.B) {
|
||||
start := `
|
||||
|
||||
|
||||
---
|
||||
title: "Front Matters"
|
||||
description: "It really does"
|
||||
---
|
||||
|
||||
This is some summary. This is some summary. This is some summary. This is some summary.
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
`
|
||||
input := []byte(start + strings.Repeat("this is not emoji: ", 50) + strings.Repeat("some text ", 70) + strings.Repeat("this is not: ", 50) + strings.Repeat("but this is a :smile: ", 3) + strings.Repeat("some text ", 70))
|
||||
cfg := Config{EnableEmoji: true}
|
||||
cfg := Config{}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
Reference in New Issue
Block a user