diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go index 9fb25e22a..53ad2fe8e 100644 --- a/hugolib/embedded_shortcodes_test.go +++ b/hugolib/embedded_shortcodes_test.go @@ -89,13 +89,13 @@ func TestShortcodeHighlight(t *testing.T) { `{{< highlight java >}} void do(); {{< /highlight >}}`, - `(?s)
}}
 void do();
 {{< /highlight >}}`,
-			`(?s)
`,
+			`(?s)
`,
 		},
 	} {
 
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 5bc3db22f..7a1ff6c4e 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -1731,12 +1731,12 @@ $$$
 
 	// Blackfriday does not support this extended attribute syntax.
 	b.AssertFileContent("public/page1/index.html",
-		`
SHORT
`, - `
MARKDOWN`,
+		`
SHORT
`, + `
MARKDOWN`,
 	)
 
 	b.AssertFileContent("public/page2/index.html",
-		`
SHORT`,
+		`
SHORT`,
 	)
 }
 
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go
index 6e6b0009f..f2c6efedd 100644
--- a/markup/goldmark/convert_test.go
+++ b/markup/goldmark/convert_test.go
@@ -154,7 +154,7 @@ description
 	c.Assert(got, qt.Contains, `

神真美好

`, qt.Commentf(got)) // Code fences - c.Assert(got, qt.Contains, "
LINE1\n
") + c.Assert(got, qt.Contains, "
LINE1\n
") c.Assert(got, qt.Contains, "Code Fences No Lexer\n
LINE1\n
") // Extensions @@ -389,7 +389,7 @@ LINE5 result := convertForConfig(c, cfg, `echo "Hugo Rocks!"`, "bash") // TODO(bep) there is a whitespace mismatch (\n) between this and the highlight template func. - c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
+		c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
 
`) result = convertForConfig(c, cfg, `echo "Hugo Rocks!"`, "unknown") c.Assert(result, qt.Equals, "
echo "Hugo Rocks!"\n
") @@ -400,7 +400,7 @@ LINE5 cfg.NoClasses = false result := convertForConfig(c, cfg, lines, `bash {linenos=table,hl_lines=[2 "4-5"],linenostart=3}`) - c.Assert(result, qt.Contains, "
\n
\n
\n
\n
4")
 
 		result = convertForConfig(c, cfg, lines, "bash {linenos=inline,hl_lines=[2]}")
diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go
index 4727843cc..772244a91 100644
--- a/markup/highlight/highlight.go
+++ b/markup/highlight/highlight.go
@@ -123,7 +123,7 @@ type preWrapper struct {
 
 func (p preWrapper) Start(code bool, styleAttr string) string {
 	w := &strings.Builder{}
-	fmt.Fprintf(w, "", styleAttr)
+	fmt.Fprintf(w, `
`, styleAttr)
 	var language string
 	if code {
 		language = p.language
diff --git a/markup/highlight/highlight_test.go b/markup/highlight/highlight_test.go
index eb8ba3e96..f68df629a 100644
--- a/markup/highlight/highlight_test.go
+++ b/markup/highlight/highlight_test.go
@@ -43,9 +43,9 @@ User-Agent: foo
 		h := New(cfg)
 
 		result, _ := h.Highlight(`echo "Hugo Rocks!"`, "bash", "")
-		c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
`) + c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
`) result, _ = h.Highlight(`echo "Hugo Rocks!"`, "unknown", "") - c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
`) + c.Assert(result, qt.Equals, `
echo "Hugo Rocks!"
`) }) c.Run("Highlight lines, default config", func(c *qt.C) { @@ -54,7 +54,7 @@ User-Agent: foo h := New(cfg) result, _ := h.Highlight(lines, "bash", "linenos=table,hl_lines=2 4-5,linenostart=3") - c.Assert(result, qt.Contains, "
\n
\n
\n
\n
4")
 
 		result, _ = h.Highlight(lines, "bash", "linenos=inline,hl_lines=2")
@@ -113,7 +113,7 @@ User-Agent: foo
 		h := New(cfg)
 
 		result, _ := h.Highlight(lines, "", "")
-		c.Assert(result, qt.Equals, "
LINE1\nLINE2\nLINE3\nLINE4\nLINE5\n
") + c.Assert(result, qt.Equals, "
LINE1\nLINE2\nLINE3\nLINE4\nLINE5\n
") }) c.Run("No language, guess syntax", func(c *qt.C) {