-
Notifications
You must be signed in to change notification settings - Fork 32
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
🐛: Anchor ids in separate renders should not affect each other. #43
Conversation
The anchors plugin remembered used anchor ids per MarkdownIt object for entire lifetime of the object. This means if you use the same MarkdownIt object to render multiple documents then the generated anchor ids will be affected by the order of rendered documents. This commit makes it clear the known ids after anchors are generated, so separate renders should not affect each other.
Thanks for submitting your first pull request! You are awesome! 🤗 |
Actually, if I'm just gonna clear the set each time clearly I should just make a new one. No reason to keep it lingering around in memory.
Also I apologize for not including the emoji in the first commit, my brain just skipped over it like it wasn't there. You lot have a system going on! I'm coming in here and messing it up. |
Codecov ReportBase: 93.19% // Head: 93.19% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #43 +/- ##
=======================================
Coverage 93.19% 93.19%
=======================================
Files 25 25
Lines 1351 1351
=======================================
Hits 1259 1259
Misses 92 92
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks, sorry for the delayed response! |
Sweet! No worries about the delay, just happy to have contributed back :) |
The anchors plugin remembered used anchor ids per MarkdownIt object for entire lifetime of the object. This means if you use the same MarkdownIt object to render multiple documents then the generated anchor ids will be affected by the order of rendered documents.
This PR makes it clear the known ids after anchors are generated, so separate renders should not affect each other.
This seems like a safe fix to my eyes but I haven't examined these systems in-depth. It does past the single anchors test still.