From 19ef27b98edca53c4138b01c0f7c7bfbeb5ffcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 4 Sep 2020 10:23:02 +0200 Subject: markup/goldmark: Add a test case Updates #7619 --- markup/goldmark/convert_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'markup') 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, "

") } +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 := ` +
This will be "slotted" into the custom element.
+
+` + + b := convert(c, mconf, input) + got := string(b.Bytes()) + + c.Assert(got, qt.Contains, "

\n

This will be “slotted” into the custom element.
\n

\n") + }) + +} + func TestCodeFence(t *testing.T) { c := qt.New(t) -- cgit v1.2.3