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

There is a bug with two or more links with same texts #145

Open
jt3k opened this issue Nov 2, 2022 · 3 comments
Open

There is a bug with two or more links with same texts #145

jt3k opened this issue Nov 2, 2022 · 3 comments

Comments

@jt3k
Copy link

jt3k commented Nov 2, 2022

if (!footnotes.has(footnote.idRef)) {
footnotes.set(footnote.idRef, footnote)
}

↑why don't we use description as a idRef in our Map ?

here i tried to recreate the problem i had↓
https://codesandbox.io/s/react-a11y-footnotes-forked-23d672?file=/src/App.js

@KittyGiraudel
Copy link
Owner

Hiii. You can easily solve your problem by passing a unique id to each Ref. It only uses the text content if no id is provided. :)

@jt3k
Copy link
Author

jt3k commented Nov 3, 2022

The problem is that I have no way to know in advance what the content will be) I use generation from html text. It would be great to be able to create identifiers incrementally. E.g. #n1 #n2 #n3

@KittyGiraudel
Copy link
Owner

I think we can probably do something like id || description, you’re right.

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