git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3556 from nunull/issue1831_footnoteBackRefs

Add class to footnote back references

commit7410d259c2ab11de0b01e37a6561eec0c9d69aaf authorJohn MacFarlane <jgm@berkeley.edu> dateTue 4 Apr 2017, 10:34 (10 years ago) parent13cee8c3e81712
3 files changed+11−11
src/Text/Pandoc/Writers/HTML.hs+1−1 test/writer.html4+5−5 test/writer.html5+5−5
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -1047,7 +1047,7 @@ blockListToNote :: PandocMonad m => WriterOptions -> String -> [Block] -> StateT
10471047blockListToNote opts ref blocks =
10481048 -- If last block is Para or Plain, include the backlink at the end of
10491049 -- that block. Otherwise, insert a new Plain block with the backlink.
1050− let backlink = [Link nullAttr [Str "↩"] ("#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref,[])]
1050+ let backlink = [Link ("",["footnoteBack"],[]) [Str "↩"] ("#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref,[])]
10511051 blocks' = if null blocks
10521052 then []
10531053 else let lastBlock = last blocks
test/writer.html4+5−5
@@ -535,14 +535,14 @@ Blah
535535<div class="footnotes">
536536<hr />
537537<ol>
538−<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.<a href="#fnref1">↩</a></p></li>
538+<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.<a href="#fnref1" class="footnoteBack">↩</a></p></li>
539539<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
540540<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
541541<pre><code> { &lt;code&gt; }</code></pre>
542−<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.<a href="#fnref2">↩</a></p></li>
543−<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text].<a href="#fnref3">↩</a></p></li>
544−<li id="fn4"><p>In quote.<a href="#fnref4">↩</a></p></li>
545−<li id="fn5"><p>In list.<a href="#fnref5">↩</a></p></li>
542+<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.<a href="#fnref2" class="footnoteBack">↩</a></p></li>
543+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text].<a href="#fnref3" class="footnoteBack">↩</a></p></li>
544+<li id="fn4"><p>In quote.<a href="#fnref4" class="footnoteBack">↩</a></p></li>
545+<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
546546</ol>
547547</div>
548548</body>
test/writer.html5+5−5
@@ -537,14 +537,14 @@ Blah
537537<section class="footnotes">
538538<hr />
539539<ol>
540−<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.<a href="#fnref1">↩</a></p></li>
540+<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.<a href="#fnref1" class="footnoteBack">↩</a></p></li>
541541<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
542542<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
543543<pre><code> { &lt;code&gt; }</code></pre>
544−<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.<a href="#fnref2">↩</a></p></li>
545−<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text].<a href="#fnref3">↩</a></p></li>
546−<li id="fn4"><p>In quote.<a href="#fnref4">↩</a></p></li>
547−<li id="fn5"><p>In list.<a href="#fnref5">↩</a></p></li>
544+<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.<a href="#fnref2" class="footnoteBack">↩</a></p></li>
545+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text].<a href="#fnref3" class="footnoteBack">↩</a></p></li>
546+<li id="fn4"><p>In quote.<a href="#fnref4" class="footnoteBack">↩</a></p></li>
547+<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
548548</ol>
549549</section>
550550</body>