git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3556 from nunull/issue1831_footnoteBackRefs
7410d25John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -1047,7 +1047,7 @@ blockListToNote :: PandocMonad m => WriterOptions -> String -> [Block] -> StateT
1047blockListToNote opts ref blocks =
1047blockListToNote opts ref blocks =
1048 -- If last block is Para or Plain, include the backlink at the end of
1048 -- If last block is Para or Plain, include the backlink at the end of
1049 -- that block. Otherwise, insert a new Plain block with the backlink.
1049 -- 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,[])]
1051 blocks' = if null blocks
1051 blocks' = if null blocks
1052 then []
1052 then []
1053 else let lastBlock = last blocks
1053 else let lastBlock = last blocks
test/writer.html4+5−5
@@ -535,14 +535,14 @@ Blah
535<div class="footnotes">
535<div class="footnotes">
536<hr />
536<hr />
537<ol>
537<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>
539<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
539<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
540<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
540<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
541<pre><code> { &lt;code&gt; }</code></pre>
541<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>
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">↩</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">↩</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">↩</a></p></li>
545+<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
546</ol>
546</ol>
547</div>
547</div>
548</body>
548</body>
test/writer.html5+5−5
@@ -537,14 +537,14 @@ Blah
537<section class="footnotes">
537<section class="footnotes">
538<hr />
538<hr />
539<ol>
539<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>
541<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
541<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
542<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
542<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
543<pre><code> { &lt;code&gt; }</code></pre>
543<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>
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">↩</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">↩</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">↩</a></p></li>
547+<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
548</ol>
548</ol>
549</section>
549</section>
550</body>
550</body>