You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implicit figures does not operate inside footnote blocks as expected. We've discovered a number of footnotes on gwern.net aren't getting <figure>-styled as expected & are screwed up because Pandoc renders them as <img> elements, despite being written the same way as any other figure-image is. The culprit seems to be that the footnotes include the image as the last block element, and this somehow does not trigger the implicit figure functionality.
An example: the basic image format works, and works inside a block footnote as long as there is any block element after the image (blockquotes, source code, text paragraphs, all seem fine). The exact same footnote, minus the trailing text, fails.

Test.[^footnote1][^footnote2]
[^footnote1]: Foo:

Bar.
[^footnote2]: Foo:

I don't see anything in the HTML <figure> standard discouraging use, and the mention of asides seems exactly like my usecase, and the Pandoc doc says only
An image with nonempty alt text, occurring by itself in a paragraph, will be rendered as a figure with a caption.
And my example clearly fulfills that description: it is inside a <p></p> paragraph, by itself, with no other elements. So this looks like a bug in the Pandoc logic where it makes some sort of assumption that 'by itself' means another block element follows the paragraph.
The text was updated successfully, but these errors were encountered:
gwern
changed the title
'Implicit figures' does not fire inside footnotes without a final block
'Implicit figures' does not fire inside footnotes without a block following the image (for final image blocks)
Jan 5, 2021
blockListToNote opts ref blocks =do...-- 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.
We include the backlink at the end of the block before processing it with blockToHtml. But that means that when it gets to blockToHtml, it's no longer an image alone in a Para, so implicit figure does not get triggered.
Implicit figures does not operate inside footnote blocks as expected. We've discovered a number of footnotes on gwern.net aren't getting
<figure>
-styled as expected & are screwed up because Pandoc renders them as<img>
elements, despite being written the same way as any other figure-image is. The culprit seems to be that the footnotes include the image as the last block element, and this somehow does not trigger the implicit figure functionality.An example: the basic image format works, and works inside a block footnote as long as there is any block element after the image (blockquotes, source code, text paragraphs, all seem fine). The exact same footnote, minus the trailing text, fails.
renders as
The first is correct and the second is wrong.
I don't see anything in the HTML
<figure>
standard discouraging use, and the mention of asides seems exactly like my usecase, and the Pandoc doc says onlyAnd my example clearly fulfills that description: it is inside a
<p></p>
paragraph, by itself, with no other elements. So this looks like a bug in the Pandoc logic where it makes some sort of assumption that 'by itself' means another block element follows the paragraph.The text was updated successfully, but these errors were encountered: