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>2018-08-17 10:01:02 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-17 10:13:39 +0300
commitbaa62d0abbbf24a17d0aa800a4bb217f026c49ad (patch)
tree5d10ff11113ef208a575b82efe0d64969f3d0059 /hugolib
parent78c99463fdd45c91af9933528d12d36a86dc6482 (diff)
hugolib: Adjust tests for shortcode p-issue
See #1642
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/shortcode_test.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index d57dca82e..8188eb48d 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -250,7 +250,7 @@ And then:
This is **plain** text.
{{< /inside >}}
-`, "<div><h1 id=\"more-here\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\n<p>And then:</p>\n\n<p><div>\n# More Here\n\nThis is **plain** text.\n\n</div>", wt)
+`, "<div><h1 id=\"more-here\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\n<p>And then:</p>\n\n<div>\n# More Here\n\nThis is **plain** text.\n\n</div>", 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<figure>\n <a href=\"/jump/here/on/clicking\" target=\"_blank\" rel=\"noopener\">\n <img src=\"/found/here\" />\n </a>\n \n</figure>\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) {