sbrl / Pepperminty-Wiki

A wiki in a box
https://peppermint.mooncarrot.space/
Mozilla Public License 2.0
177 stars 20 forks source link

Image caption breaks footnotes #209

Closed SeanFromIT closed 3 years ago

SeanFromIT commented 3 years ago

Images with captions cause the footnotes to not render (like, the whole <div class="footnotes"> is missing). Remove | caption from the image, they render. ¯_(ツ)_/¯

v0.22-beta1

sbrl commented 3 years ago

Oh my! That's very strange. Do you have some minimal test markdown I can use to debug this please? It's going to require some intensive debugging I think.

SeanFromIT commented 3 years ago

https://gist.github.com/SeanFromIT/1b44900aed9df64057fac153f0a2f911

sbrl commented 3 years ago

Got it! That was an interesting one. For future reference calling ->text() when recursively parsing is a bad idea: it calls ->textElements(), which resets ->DefinitionData, which contains information about footnotes.

This bug was also caused by the templating engine - this has been fixed too.

Due to the complex nature of this bug, if you have any issues relating to this fix please open a new issue and reference this bug in your description.