summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-04-11 13:17:25 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-04-11 13:17:25 +0200
commitcd558958a0c0ecd06f7560a38e27334fe983e0de (patch)
treeb6840ee6381ed7b053fcdce22e2d27e6a6d9a400 /hugolib/shortcode_test.go
parent5ef52294f90c51697bd3f918b3c3ed83baff657a (diff)
Use Node.ID for anchor ID
Fixes #2057
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r--hugolib/shortcode_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index ab764b845..68c7f9220 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -168,6 +168,9 @@ func TestInnerSC(t *testing.T) {
}
func TestInnerSCWithMarkdown(t *testing.T) {
+ setUp()
+ defer tearDown()
+
tem := tpl.New()
tem.AddInternalShortcode("inside.html", `<div{{with .Get "class"}} class="{{.}}"{{end}}>{{ .Inner }}</div>`)
@@ -176,10 +179,12 @@ func TestInnerSCWithMarkdown(t *testing.T) {
[link](http://spf13.com) and text
-{{% /inside %}}`, "<div><h1 id=\"more-here:bec3ed8ba720b9073ab75abcf3ba5d97\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>", tem)
+{{% /inside %}}`, "<div><h1 id=\"more-here:42\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>", tem)
}
func TestInnerSCWithAndWithoutMarkdown(t *testing.T) {
+ setUp()
+ defer tearDown()
tem := tpl.New()
tem.AddInternalShortcode("inside.html", `<div{{with .Get "class"}} class="{{.}}"{{end}}>{{ .Inner }}</div>`)
@@ -198,7 +203,7 @@ And then:
This is **plain** text.
{{< /inside >}}
-`, "<div><h1 id=\"more-here:bec3ed8ba720b9073ab75abcf3ba5d97\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\nAnd then:\n\n<div>\n# More Here\n\nThis is **plain** text.\n\n</div>\n", tem)
+`, "<div><h1 id=\"more-here:42\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\nAnd then:\n\n<div>\n# More Here\n\nThis is **plain** text.\n\n</div>\n", tem)
}
func TestEmbeddedSC(t *testing.T) {