From fb6057bf26ca664756cfb4b32f09353eb3942925 Mon Sep 17 00:00:00 2001 From: yuin Date: Sat, 23 Apr 2022 21:57:18 +0900 Subject: [PATCH] Fix #256 --- extension/_test/footnote.txt | 16 ++++++++-------- extension/footnote.go | 12 ++---------- extension/footnote_test.go | 8 ++++---- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/extension/_test/footnote.txt b/extension/_test/footnote.txt index dcfc182..185aeef 100644 --- a/extension/_test/footnote.txt +++ b/extension/_test/footnote.txt @@ -7,7 +7,7 @@ That's some text with a footnote.[^1] That's the second paragraph. //- - - - - - - - -//

That's some text with a footnote.1

-
+

  1. @@ -15,7 +15,7 @@ That's some text with a footnote.[^1]

    That's the second paragraph. ↩︎

-
+ //= = = = = = = = = = = = = = = = = = = = = = = =// 3 @@ -33,7 +33,7 @@ This[^3] is[^1] text with footnotes[^2]. [^3]: Footnote three //- - - - - - - - -//

This1 is2 text with footnotes3.

-
+

  1. @@ -46,7 +46,7 @@ This[^3] is[^1] text with footnotes[^2].

    Footnote two ↩︎

-
+ //= = = = = = = = = = = = = = = = = = = = = = = =// @@ -57,14 +57,14 @@ test![^1] [^1]: footnote //- - - - - - - - -//

test!1

-
+

  1. footnote ↩︎

-
+ //= = = = = = = = = = = = = = = = = = = = = = = =// 6: Multiple references to the same footnotes should have different ids @@ -80,12 +80,12 @@ something[^fn:1]

something1

something1

something1

-
+

  1. footnote text ↩︎ ↩︎ ↩︎

-
+ //= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/extension/footnote.go b/extension/footnote.go index 2d33548..0df0e55 100644 --- a/extension/footnote.go +++ b/extension/footnote.go @@ -601,14 +601,8 @@ func (r *FootnoteHTMLRenderer) renderFootnote(w util.BufWriter, source []byte, n } func (r *FootnoteHTMLRenderer) renderFootnoteList(w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { - tag := "section" - if r.Config.XHTML { - tag = "div" - } if entering { - _, _ = w.WriteString("<") - _, _ = w.WriteString(tag) - _, _ = w.WriteString(` class="footnotes" role="doc-endnotes"`) + _, _ = w.WriteString(`
\n") } else { _, _ = w.WriteString("\n") - _, _ = w.WriteString("\n") + _, _ = w.WriteString("
\n") } return gast.WalkContinue, nil } diff --git a/extension/footnote_test.go b/extension/footnote_test.go index 4b5ea1d..f2a7ded 100644 --- a/extension/footnote_test.go +++ b/extension/footnote_test.go @@ -65,7 +65,7 @@ Another one.[^2] Expected: `

That's some text with a footnote.1

Same footnote.1

Another one.2

-
+

  1. @@ -75,7 +75,7 @@ Another one.[^2]

    Another footnote. ^

-
`, +`, }, t, ) @@ -124,7 +124,7 @@ Another one.[^2] Expected: `

That's some text with a footnote.1

Same footnote.1

Another one.2

-
+

  1. @@ -134,7 +134,7 @@ Another one.[^2]

    Another footnote. ^

-
`, +`, }, t, )