Skip to content
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

Square brackets [ inside footnotes break footnote #7

Closed
moritzebeling opened this issue Apr 19, 2021 · 3 comments
Closed

Square brackets [ inside footnotes break footnote #7

moritzebeling opened this issue Apr 19, 2021 · 3 comments

Comments

@moritzebeling
Copy link

moritzebeling commented Apr 19, 2021

First of all: Thank you for this wonderful plugin! And the fix to use it within blocks!

Now: Having square brackets [ inside a footnote breaks the footnote. Which makes sense, because the regex looking out for footnotes found a ] and thus ends the footnote.

On the other hand: It is not unusual to have square brackets inside a footnote, e.g. [...] or to indicate that the editor changed the exact wording of some source, resulting in something like [^Footnote [...] text].

I think, the regex that looks out for [^ should only end a footnote, when it finds a ] AND in the meantime has found as many closing brackets as opening brackets it might have found in between. So after [^...[ the footnote only ends on the second ] it finds...

Thank you four considering.

@rasteiner
Copy link
Contributor

I feel like counting brackets leads to a rabbit hole that doesn't end well, plus it doesn't offer a solution for every case:
What if I want to draw your avatar in a footnote?

[^   moritzebeling's avatar kinda looks like :]   ]

Supporting escape sequences could be more flexible, even if they might require some explaining:

[^   moritzebeling's avatar kinda looks like :\]   ]

@dect0r
Copy link

dect0r commented Feb 7, 2023

Is there any progress or a temporary workaround for this?

@sylvainjule
Copy link
Owner

I have added support for escaped brackets inside a note ✓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants