mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 10:16:32 +00:00
Add class to footnote back references
The HTML writer now also adds the class footnoteBack to back references of footnotes. This allows for easier CSS styling.
This commit is contained in:
@@ -1047,7 +1047,7 @@ blockListToNote :: PandocMonad m => WriterOptions -> String -> [Block] -> StateT
|
||||
blockListToNote opts ref blocks =
|
||||
-- If last block is Para or Plain, include the backlink at the end of
|
||||
-- that block. Otherwise, insert a new Plain block with the backlink.
|
||||
let backlink = [Link nullAttr [Str "↩"] ("#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref,[])]
|
||||
let backlink = [Link ("",["footnoteBack"],[]) [Str "↩"] ("#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref,[])]
|
||||
blocks' = if null blocks
|
||||
then []
|
||||
else let lastBlock = last blocks
|
||||
|
||||
+5
-5
@@ -535,14 +535,14 @@ Blah
|
||||
<div class="footnotes">
|
||||
<hr />
|
||||
<ol>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
|
||||
<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
|
||||
<pre><code> { <code> }</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn4"><p>In quote.<a href="#fnref4">↩</a></p></li>
|
||||
<li id="fn5"><p>In list.<a href="#fnref5">↩</a></p></li>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn4"><p>In quote.<a href="#fnref4" class="footnoteBack">↩</a></p></li>
|
||||
<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
|
||||
</ol>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+5
-5
@@ -537,14 +537,14 @@ Blah
|
||||
<section class="footnotes">
|
||||
<hr />
|
||||
<ol>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
|
||||
<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
|
||||
<pre><code> { <code> }</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn4"><p>In quote.<a href="#fnref4">↩</a></p></li>
|
||||
<li id="fn5"><p>In list.<a href="#fnref5">↩</a></p></li>
|
||||
<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>
|
||||
<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>
|
||||
<li id="fn4"><p>In quote.<a href="#fnref4" class="footnoteBack">↩</a></p></li>
|
||||
<li id="fn5"><p>In list.<a href="#fnref5" class="footnoteBack">↩</a></p></li>
|
||||
</ol>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user