-
Notifications
You must be signed in to change notification settings - Fork 51
feature: Render footnotes #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
## Details Request: #241 When the contents of a link starts with the ^ symbol we'll now assume this is related to a footnote. When the footnote pattern is spotted we replace the link contents with a superscript equivalent when possible. There are some interesting gaps in the superscript glyphs, I do not know why they exist, but they exist for parens, 0-9, most of a-z, and also most of A-Z but both character sets have at least one missing glyph. This behavior can be disabled by setting `link.footnote.superscript` to `false`. Since the translation between base character and superscript is not based on a shared offset or anything easy like that we maintain a complete mapping of base character to superscript. If there are any missing characters in the mapping then we skip doing any sort of superscript rendering.
Thank you for the kind words, glad you are enjoying the plugin! Added this feature here: 634acd5 LMK if this is what you had in mind! |
That was quick! Yes that was what I was asking for. Thanks a lot! |
Hi - sorry for reopening this. It works well, but after playing around with it a bit I'm wondering, if it is not too much hassle, if you could either remove the paranthesis or add a config / option for that. The paranthesis adds unnecessary spacing which I guess is due to monospace font. Just having the superscript would also make it less noisy |
## Details Request: #241 Rather than surrounding footnotes in parenthesis by default the prefix and suffix are now configurable properties. The default behavior has changed in that nothing is added by default. To get the previous behavior users can set the following: ```lua require('render-markdown').setup({ link = { footnote = { prefix = '(', suffix = ')' }, }, }) ```
Sure, updated the behavior here: 1b5d117 The |
Is your feature request related to a problem? Please describe.
I use footnotes in my notes and it would be nice if it would be rendered by this wonderful plugin.
To quote this post:
Also note that Github now supports footnotes in their markdown, so this is not "just Obsidian".
It would be a great addition imho which shouldn't be too hard to implement, I think?
Thanks again for a great plugin!
Describe the solution you'd like
should be rendered as
Sam⁽¹⁾ is almost two years old. ## Footnotes ⁽¹⁾: Sam is my son
Paranthesis have to be used instead of brackets as (to my knowledge) you can't use brackets in superscript utf8 (or?). But I think paranthesis are alright.
Describe alternatives you've considered
Just having it as is.
Additional information
Perhaps there are some configuration options, but as a first step I propose just implementing the above.
Note that the main obstacle with footnotes is creating / formatting / maintaining them, but this is not the scope of this plugin. There are other plugins that can help with that.
Note: Only caret symbols
[^....]
should be rendered this way, as to not interfer with other thingsThe text was updated successfully, but these errors were encountered: