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

add ability to reference same footnote multiple times #83

Open
nyancrimew opened this issue Apr 3, 2024 · 4 comments
Open

add ability to reference same footnote multiple times #83

nyancrimew opened this issue Apr 3, 2024 · 4 comments

Comments

@nyancrimew
Copy link

it would be nice if instead of simply not rendering at all, footnoterefs without a content but sharing an anchor with an existing footnote instead linked to the same footnote. a usecase of this would for example be a news article mentioning multiple different sources for whom pseudonyms are used, a single footnote could be used to explain this for all of them.

@KittyGiraudel
Copy link
Owner

Oh wow, you’re the nyancrimew, from Twitter! (although I just noticed your account got suspended smh) 🙀

Besides me fangirling, yes, it feels like a good idea. I didn’t really plan on working on this again, but maybe I can find a moment to see how complicated it would be soon-ish. Thanks for suggesting!

@nyancrimew
Copy link
Author

that is me indeed (and im back on twitter again btw), would be cool to see if this works, though i've now realized it would complicate the whole css counter for numbered links thing but i'll see about that once it actually becomes a problem :p

and no hurry!

@KittyGiraudel
Copy link
Owner

KittyGiraudel commented Apr 5, 2024

Alright, I tried to think a bit about this. There are 2 problems to make it work — one simple to solve, and one not:

  1. Right now, a footnote reference without a content argument is skipped entirely. We could easily have an option to challenge that and let “dead-end” footnote refs still be rendered. Easy.
  2. The whole premise is to leverage CSS counters to for the numbering, so we don’t cary a bunch of logic to reproduce that behavior. As per the suggestion, we increment the counter with every footnote reference. So even if refs A, B, C all point to the same footnote and only A defines the footnote content, B and C being void, we still have A bumping the counter by 1, B by 1 and C by 1. We don’t have a concept of unicity on attributes.

I don’t know if it’s solvable without dropping CSS counters entirely. Ultimately, we would like to only increase the counter for refs with an ID which didn’t already cause a counter increment.

@nyancrimew
Copy link
Author

yeah 2. is also what i have been worried about, the only thing i could think of for it is potentially some really cursed set-up with counter-set? but i havent really looked into how possible it would be

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

2 participants