summaryrefslogtreecommitdiffstats
path: root/markup/goldmark/render_hooks.go
diff options
context:
space:
mode:
Diffstat (limited to 'markup/goldmark/render_hooks.go')
-rw-r--r--markup/goldmark/render_hooks.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index 12cf00455..1e91f7ab1 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -499,10 +499,10 @@ func (r *hookedRenderer) renderHeading(w util.BufWriter, source []byte, node ast
text := ctx.PopRenderedString()
- // All ast.Heading nodes are guaranteed to have an attribute called "id"
- // that is an array of bytes that encode a valid string.
- anchori, _ := n.AttributeString("id")
- anchor := anchori.([]byte)
+ var anchor []byte
+ if anchori, ok := n.AttributeString("id"); ok {
+ anchor, _ = anchori.([]byte)
+ }
page, pageInner := render.GetPageAndPageInner(ctx)