diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index d57dca82e47..8188eb48d53 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -250,7 +250,7 @@ And then:
This is **plain** text.
{{< /inside >}}
-`, "
More Here
\n\n
link and text
\n
\n\nAnd then:
\n\n\n# More Here\n\nThis is **plain** text.\n\n
", wt)
+`, "More Here
\n\n
link and text
\n
\n\nAnd then:
\n\n\n# More Here\n\nThis is **plain** text.\n\n
", wt)
}
func TestEmbeddedSC(t *testing.T) {
@@ -335,6 +335,20 @@ func TestFigureLinkWithTargetAndRel(t *testing.T) {
CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_blank" rel="noopener" >}}`, "\n\n", nil)
}
+// #1642
+func TestShortcodeWrappedInPIssue(t *testing.T) {
+ t.Parallel()
+ wt := func(tem tpl.TemplateHandler) error {
+ tem.AddTemplate("_internal/shortcodes/bug.html", `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`)
+ return nil
+ }
+ CheckShortCodeMatch(t, `
+{{< bug >}}
+
+{{< bug >}}
+`, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", wt)
+}
+
const testScPlaceholderRegexp = "HAHAHUGOSHORTCODE-\\d+HBHB"
func TestExtractShortcodes(t *testing.T) {