Skip to content

Commit 1f30fbb

Browse files
authored
fix: Use 'written_footnote_ix' (index) in place of named tag
1 parent c262f15 commit 1f30fbb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/html.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ static bool S_put_footnote_backref(cmark_html_renderer *renderer, cmark_strbuf *
6363
if (renderer->written_footnote_ix >= renderer->footnote_ix)
6464
return false;
6565
renderer->written_footnote_ix = renderer->footnote_ix;
66-
66+
char m[32];
67+
snprintf(m, sizeof(m), "%d", renderer->written_footnote_ix);
68+
6769
cmark_strbuf_puts(html, "<a href=\"#fnref-");
6870
houdini_escape_href(html, node->as.literal.data, node->as.literal.len);
6971
cmark_strbuf_puts(html, "\" class=\"footnote-backref\" data-footnote-backref aria-label=\"Back to reference ");
70-
houdini_escape_href(html, node->as.literal.data, node->as.literal.len);
72+
cmark_strbuf_puts(html, m);
7173
cmark_strbuf_puts(html, "\">↩</a>");
7274

7375
if (node->footnote.def_count > 1)

0 commit comments

Comments
 (0)