parent
385b6a3b21
commit
15ba184e6e
2 changed files with 27 additions and 3 deletions
|
@ -1455,11 +1455,15 @@ blockListToNote opts ref blocks = do
|
|||
else let lastBlock = last blocks
|
||||
otherBlocks = init blocks
|
||||
in case lastBlock of
|
||||
(Para lst) -> otherBlocks ++
|
||||
Para [Image _ _ (_,tit)]
|
||||
| "fig:" `T.isPrefixOf` tit
|
||||
-> otherBlocks ++ [lastBlock,
|
||||
Plain backlink]
|
||||
Para lst -> otherBlocks ++
|
||||
[Para (lst ++ backlink)]
|
||||
(Plain lst) -> otherBlocks ++
|
||||
Plain lst -> otherBlocks ++
|
||||
[Plain (lst ++ backlink)]
|
||||
_ -> otherBlocks ++ [lastBlock,
|
||||
_ -> otherBlocks ++ [lastBlock,
|
||||
Plain backlink]
|
||||
contents <- blockListToHtml opts blocks'
|
||||
let noteItem = H.li ! prefixedId opts ("fn" <> ref) $ contents
|
||||
|
|
20
test/command/7006.md
Normal file
20
test/command/7006.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
```
|
||||
% pandoc -t html
|
||||
Test.[^fn]
|
||||
|
||||
[^fn]: Foo:
|
||||
|
||||
![Caption.](/image.jpg)
|
||||
^D
|
||||
<p>Test.<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a></p>
|
||||
<section class="footnotes" role="doc-endnotes">
|
||||
<hr />
|
||||
<ol>
|
||||
<li id="fn1" role="doc-endnote"><p>Foo:</p>
|
||||
<figure>
|
||||
<img src="/image.jpg" alt="Caption." /><figcaption aria-hidden="true">Caption.</figcaption>
|
||||
</figure>
|
||||
<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></li>
|
||||
</ol>
|
||||
</section>
|
||||
```
|
Loading…
Reference in a new issue