mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
markup/goldmark: Add the Hugo Goldmark Extras "delete" extension
With Goldmark v1.7.1 and earlier, the Goldmark "strikethrough" extension was triggered by wrapping text within a pair of double-tilde characters. With Goldmark v1.7.2 and later, to provide full GFM compatibility, the Goldmark "strikethrough" extension is triggered by wrapping text within a pair of single- or double-tilde characters. This change created a conflict with the Hugo Goldmark Extras "subscript" extension. When enabling the Hugo Goldmark Extras "subscript" extension, if you want to render subscript and strikethrough text concurrently, you must: 1. Disable the Goldmark "strikethrough" extension 2. Enable the Hugo Goldmark Extras "delete" extension Closes #12597
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
ad6d91cabd
commit
8efc75b73f
@@ -751,6 +751,10 @@ func TestExtrasExtension(t *testing.T) {
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
[markup.goldmark.extensions]
|
||||
strikethrough = false
|
||||
[markup.goldmark.extensions.extras.delete]
|
||||
enable = false
|
||||
[markup.goldmark.extensions.extras.insert]
|
||||
enable = false
|
||||
[markup.goldmark.extensions.extras.mark]
|
||||
@@ -765,6 +769,8 @@ enable = false
|
||||
---
|
||||
title: home
|
||||
---
|
||||
~~delete~~
|
||||
|
||||
++insert++
|
||||
|
||||
==mark==
|
||||
@@ -777,6 +783,7 @@ H~2~0
|
||||
b := hugolib.Test(t, files)
|
||||
|
||||
b.AssertFileContent("public/index.html",
|
||||
"<p>~~delete~~</p>",
|
||||
"<p>++insert++</p>",
|
||||
"<p>==mark==</p>",
|
||||
"<p>H~2~0</p>",
|
||||
@@ -788,6 +795,7 @@ H~2~0
|
||||
b = hugolib.Test(t, files)
|
||||
|
||||
b.AssertFileContent("public/index.html",
|
||||
"<p><del>delete</del></p>",
|
||||
"<p><ins>insert</ins></p>",
|
||||
"<p><mark>mark</mark></p>",
|
||||
"<p>H<sub>2</sub>0</p>",
|
||||
|
Reference in New Issue
Block a user