Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-09-04 11:23:02 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-09-04 11:23:02 +0300
commit19ef27b98edca53c4138b01c0f7c7bfbeb5ffcf1 (patch)
treeb20bab9015955b95a47d73a7a2ddfa1ee46d4065
parentc6b661de826f3ed8768a97a5178b4e020cb2ace1 (diff)
markup/goldmark: Add a test case
Updates #7619
-rw-r--r--markup/goldmark/convert_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go
index 4264f2268..9500d2aac 100644
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -195,6 +195,26 @@ func TestConvertAutoIDBlackfriday(t *testing.T) {
c.Assert(got, qt.Contains, "<h2 id=\"let-s-try-this-shall-we\">")
}
+func TestConvertIssues(t *testing.T) {
+ c := qt.New(t)
+
+ // https://github.com/gohugoio/hugo/issues/7619
+ c.Run("Hyphen in HTML attributes", func(c *qt.C) {
+ mconf := markup_config.Default
+ mconf.Goldmark.Renderer.Unsafe = true
+ input := `<custom-element>
+ <div>This will be "slotted" into the custom element.</div>
+</custom-element>
+`
+
+ b := convert(c, mconf, input)
+ got := string(b.Bytes())
+
+ c.Assert(got, qt.Contains, "<p><custom-element>\n<div>This will be &ldquo;slotted&rdquo; into the custom element.</div>\n</custom-element></p>\n")
+ })
+
+}
+
func TestCodeFence(t *testing.T) {
c := qt.New(t)