ref: 19ef27b98edca53c4138b01c0f7c7bfbeb5ffcf1
parent: c6b661de826f3ed8768a97a5178b4e020cb2ace1
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Fri Sep 4 06:23:02 EDT 2020
markup/goldmark: Add a test case Updates #7619
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -195,6 +195,26 @@
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 “slotted” into the custom element.</div>\n</custom-element></p>\n")
+ })
+
+}
+
func TestCodeFence(t *testing.T) {
c := qt.New(t)