Support code in footnotes
Would love support for code in footnotes - if I try to add some, it ends up above the footnote section and doesn't remove the backticks:
Same thing happened when I tried to use quotes in a footnote.
~~I think that this might be a premium feature:~~
Here's what you get when you upgrade:
- ...
- Add code to head and footer elements
https://bearblog.dev/dashboard/upgrade/
It's not a premium feature. This is just a rendering issue with Mistune, the markdown renderer. It currently doesn't support codeblocks in footnotes (or at least supports it very badly). I'll see what I can do to patch this.
Apologies if we are duplicating work, but since I was already looking at Mistune to resolve the "long footnotes" issue, I also tried my hand at patching Mistune to parse code blocks in footnotes. I think it does depend on the other patch to go through though, otherwise any footnotes with indentation level 4 will get parsed as an "unfenced code block", rather than regular paragraphs that happen to be in a footnote.
Edit: The changes got merged into Mistune, so hopefully updating that on the bear blog side will resolve this issue
I've just bumped Mistune to the latest version. It seems to have resolved the issue with the backticks, but I'm still seeing the code block render above the footnotes. Please check to see if this is happening on your end as well.
I am seeing the same behavior where the backticks are no longer appearing (and the code block is syntax highlighted properly), but is appearing above the footnotes section. Did you bump Mistune to the latest tag, or latest commit? I don't think the recent changes have been released in any version yet, and you might need to pull from Mistune's main branch instead.
(I'm not super experienced with how the dependencies are set up for this project, so forgive my ignorance if this is a stupid question)
Has it been considered to use a CommonMark-compliant parser for converting to HTML, e.g. umarkdown? I've noticed that there are a couple other issues here related to markdown parsing. I'd also be happy to take a stab at it if this is something worth pursuing