diff --git a/src/html.c b/src/html.c index 7836f0052..529e0ea31 100644 --- a/src/html.c +++ b/src/html.c @@ -68,7 +68,9 @@ static bool S_put_footnote_backref(cmark_html_renderer *renderer, cmark_strbuf * cmark_strbuf_puts(html, "as.literal.data, node->as.literal.len); - cmark_strbuf_puts(html, "\" class=\"footnote-backref\" data-footnote-backref aria-label=\"Back to reference "); + cmark_strbuf_puts(html, "\" class=\"footnote-backref\" data-footnote-backref data-footnote-backref-idx=\""); + cmark_strbuf_puts(html, m); + cmark_strbuf_puts(html, "\" aria-label=\"Back to reference "); cmark_strbuf_puts(html, m); cmark_strbuf_puts(html, "\">↩"); @@ -82,7 +84,11 @@ static bool S_put_footnote_backref(cmark_html_renderer *renderer, cmark_strbuf * houdini_escape_href(html, node->as.literal.data, node->as.literal.len); cmark_strbuf_puts(html, "-"); cmark_strbuf_puts(html, n); - cmark_strbuf_puts(html, "\" class=\"footnote-backref\" data-footnote-backref aria-label=\"Back to reference "); + cmark_strbuf_puts(html, "\" class=\"footnote-backref\" data-footnote-backref data-footnote-backref-idx=\""); + cmark_strbuf_puts(html, m); + cmark_strbuf_puts(html, "-"); + cmark_strbuf_puts(html, n); + cmark_strbuf_puts(html, "\" aria-label=\"Back to reference "); cmark_strbuf_puts(html, m); cmark_strbuf_puts(html, "-"); cmark_strbuf_puts(html, n); diff --git a/test/extensions.txt b/test/extensions.txt index 580242ffc..fe98fe548 100644 --- a/test/extensions.txt +++ b/test/extensions.txt @@ -737,7 +737,7 @@ Hi!
  1. -

    Some bolded footnote definition.

    +

    Some bolded footnote definition.

  2. @@ -745,15 +745,15 @@ Hi!
    as well as code blocks
     
    -

    or, naturally, simple paragraphs.

    +

    or, naturally, simple paragraphs.

  3. -

    no code block here (spaces are stripped away)

    +

    no code block here (spaces are stripped away)

  4. this is now a code block (8 spaces indentation)
     
    - +
@@ -773,7 +773,7 @@ This footnote is referenced[^a-footnote] multiple times, in lots of different pl
  1. -

    This footnote definition should have three backrefs. 2 3

    +

    This footnote definition should have three backrefs. 2 3

@@ -790,7 +790,7 @@ Hello[^">]
  1. -

    pwned

    +

    pwned

diff --git a/test/regression.txt b/test/regression.txt index 55a1c71a5..1334a674a 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -194,7 +194,7 @@ A footnote in a paragraph[^1]
  1. -

    a footnote 2

    +

    a footnote 2

@@ -284,10 +284,10 @@ This is some text. It has a citation.[^citation]
  1. -

    This is a long winded parapgraph that also has another citation.2

    +

    This is a long winded parapgraph that also has another citation.2

  2. -

    My second citation.

    +

    My second citation.

@@ -306,10 +306,10 @@ This is some text. It has two footnotes references, side-by-side without any spa
  1. -

    Hello.

    +

    Hello.

  2. -

    Goodbye.

    +

    Goodbye.

@@ -331,10 +331,10 @@ It has another footnote that contains many different characters (the autolinker
  1. -

    this renders properly.

    +

    this renders properly.

  2. -

    so does this.

    +

    so does this.