git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Fixed footnote backlinks with --id-prefix.

Closes #4235.

commite3f01235e9966d662bb956dbdc66c0f64c759d0a authorJohn MacFarlane <jgm@berkeley.edu> dateTue 9 Jan 2018, 15:29 (9 years ago) parent87e1656
2 files changed+13−1
src/Text/Pandoc/Writers/HTML.hs+1−1 test/command/4235.md+12
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -1150,7 +1150,7 @@ blockListToNote :: PandocMonad m => WriterOptions -> String -> [Block] -> StateT
11501150blockListToNote opts ref blocks =
11511151 -- If last block is Para or Plain, include the backlink at the end of
11521152 -- that block. Otherwise, insert a new Plain block with the backlink.
1153− let backlink = [Link ("",["footnote-back"],[]) [Str "↩"] ("#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref,[])]
1153+ let backlink = [Link ("",["footnote-back"],[]) [Str "↩"] ("#" ++ "fnref" ++ ref,[])]
11541154 blocks' = if null blocks
11551155 then []
11561156 else let lastBlock = last blocks
test/command/4235.mdnew file+12
@@ -0,0 +1,12 @@
1+```
2+% pandoc --id-prefix='foo'
3+This.^[Has a footnote.]
4+^D
5+<p>This.<a href="#foofn1" class="footnote-ref" id="foofnref1"><sup>1</sup></a></p>
6+<section class="footnotes">
7+<hr />
8+<ol>
9+<li id="foofn1"><p>Has a footnote.<a href="#foofnref1" class="footnote-back">↩</a></p></li>
10+</ol>
11+</section>
12+```