summaryrefslogtreecommitdiffstats
path: root/helpers/content_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 /helpers/content_test.go
parent5ef52294f90c51697bd3f918b3c3ed83baff657a (diff)
Use Node.ID for anchor ID
Fixes #2057
Diffstat (limited to 'helpers/content_test.go')
-rw-r--r--helpers/content_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/helpers/content_test.go b/helpers/content_test.go
index a89b4992e..347884f0a 100644
--- a/helpers/content_test.go
+++ b/helpers/content_test.go
@@ -172,15 +172,15 @@ func TestGetHTMLRendererAllFlags(t *testing.T) {
func TestGetHTMLRendererAnchors(t *testing.T) {
ctx := &RenderingContext{}
- ctx.DocumentID = "testid"
+ ctx.DocumentID = 123
ctx.Config = ctx.getConfig()
ctx.Config.PlainIDAnchors = false
actualRenderer := getHTMLRenderer(0, ctx)
headerBuffer := &bytes.Buffer{}
footnoteBuffer := &bytes.Buffer{}
- expectedFootnoteHref := []byte("href=\"#fn:testid:href\"")
- expectedHeaderID := []byte("<h1 id=\"id:testid\"></h1>\n")
+ expectedFootnoteHref := []byte("href=\"#fn:123:href\"")
+ expectedHeaderID := []byte("<h1 id=\"id:123\"></h1>\n")
actualRenderer.Header(headerBuffer, func() bool { return true }, 1, "id")
actualRenderer.FootnoteRef(footnoteBuffer, []byte("href"), 1)
@@ -196,14 +196,14 @@ func TestGetHTMLRendererAnchors(t *testing.T) {
func TestGetMmarkHTMLRenderer(t *testing.T) {
ctx := &RenderingContext{}
- ctx.DocumentID = "testid"
+ ctx.DocumentID = 321
ctx.Config = ctx.getConfig()
ctx.Config.PlainIDAnchors = false
actualRenderer := getMmarkHTMLRenderer(0, ctx)
headerBuffer := &bytes.Buffer{}
footnoteBuffer := &bytes.Buffer{}
- expectedFootnoteHref := []byte("href=\"#fn:testid:href\"")
+ expectedFootnoteHref := []byte("href=\"#fn:321:href\"")
expectedHeaderID := []byte("<h1 id=\"id\"></h1>")
actualRenderer.FootnoteRef(footnoteBuffer, []byte("href"), 1)