Upgrade markdown-it-anchor to 5.0.0 and fix anchor tag scrolling #469
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] Bug fix
Part of #413.
What is the rationale for this request?
[email protected]creates anchor tags with URL encoded characters when the heading contains special characters. For example, "Guideline: Avoid Unsafe Shortcuts" becomesguideline%3A-avoid-unsafe-shortcuts. This breaks the use of jQuery to scroll to the correct anchor as jQuery will not be able to locate elements with special characters in theid. This can be fixed by usingdocument.getElementByIdto locate the element instead.What changes did you make? (Give an overview)
Upgrade
markdown-it-anchorto^5.0.0and usedocument.getElementByIdto locate the element to scroll to instead of jQuery.Provide some example code that this change will affect:
## Guideline: Avoid Unsafe ShortcutsTesting instructions:
:. The anchor link should be able to scroll normally despite being generated from[email protected].