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

self-referencing footnotes spin mdq into an infinite loop #188

Open
yshavit opened this issue Aug 26, 2024 · 1 comment
Open

self-referencing footnotes spin mdq into an infinite loop #188

yshavit opened this issue Aug 26, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@yshavit
Copy link
Owner

yshavit commented Aug 26, 2024

Body with some footnote[^1].

[^1]: footnote text references itself[^1].

Body with some footnote1.


We spin into an infinite loop on this even in tree.rs, before even getting to selectors or output.

Footnotes

  1. footnote text references itself1. 2

@yshavit yshavit added the bug Something isn't working label Aug 26, 2024
@yshavit yshavit added this to the first beta milestone Aug 26, 2024
@yshavit
Copy link
Owner Author

yshavit commented Aug 26, 2024

Note that this can also happen with a mult-node hop; footnote [^1] references [^2] which references [^1].

yshavit added a commit that referenced this issue Aug 26, 2024
Links can't contain other links or footnotes -- but footnotes can
contain either. Add tests and logic to handle it.

Resolves #98.

I found #188 (footnotes that cycle back to themselves) while writing
tests for this, but that's a special case, so I'm going to handle it
separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant