mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Merge pull request #51 from adiabatic/master
Improve display of footnote backlinks
This commit is contained in:
commit
567046a85d
2 changed files with 4 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ That's some text with a footnote.[^1]
|
||||||
<ol>
|
<ol>
|
||||||
<li id="fn:1" role="doc-endnote">
|
<li id="fn:1" role="doc-endnote">
|
||||||
<p>And that's the footnote.</p>
|
<p>And that's the footnote.</p>
|
||||||
<p>That's the second paragraph.<a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩</a></p>
|
<p>That's the second paragraph. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -26,7 +26,7 @@ That's some text with a footnote.[^1]
|
||||||
<hr>
|
<hr>
|
||||||
<ol>
|
<ol>
|
||||||
<li id="fn:1" role="doc-endnote">
|
<li id="fn:1" role="doc-endnote">
|
||||||
<p>0 [^]:<a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩</a></p>
|
<p>0 [^]: <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -237,10 +237,10 @@ func (r *FootnoteHTMLRenderer) renderFootnoteBackLink(w util.BufWriter, source [
|
||||||
if entering {
|
if entering {
|
||||||
n := node.(*ast.FootnoteBackLink)
|
n := node.(*ast.FootnoteBackLink)
|
||||||
is := strconv.Itoa(n.Index)
|
is := strconv.Itoa(n.Index)
|
||||||
_, _ = w.WriteString(`<a href="#fnref:`)
|
_, _ = w.WriteString(` <a href="#fnref:`)
|
||||||
_, _ = w.WriteString(is)
|
_, _ = w.WriteString(is)
|
||||||
_, _ = w.WriteString(`" class="footnote-backref" role="doc-backlink">`)
|
_, _ = w.WriteString(`" class="footnote-backref" role="doc-backlink">`)
|
||||||
_, _ = w.WriteString("↩")
|
_, _ = w.WriteString("↩︎")
|
||||||
_, _ = w.WriteString(`</a>`)
|
_, _ = w.WriteString(`</a>`)
|
||||||
}
|
}
|
||||||
return gast.WalkContinue, nil
|
return gast.WalkContinue, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue