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

fix(anchors): use entire heading text for auto named anchors #384

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

d3m1d0v
Copy link
Member

@d3m1d0v d3m1d0v commented Mar 4, 2024

Auto-named anchors used only last text token of heading. I fixed that, and now auto-naming is generated from contents of all text tokens of heading.

Also, it fixed some cases where inline markup got into auto-generated anchors and they became broken

Example markup: ## _Lorem ~~ipsum **dolor** sit~~ amet_
Before: auto anchor is #amet
Now: auto anchor is #lorem-ipsum-dolor-sit-amet

Auto-named anchors used only last _text_ token of heading.
I fixed that, and now auto-naming is generated from contents of all _text_ tokens of heading.

Also, it fixed some cases where inline markup got into auto-generated anchors and they became broken

_Example markup_: `## _Lorem ~~ipsum **dolor** sit~~ amet_`
__Before__: auto anchor is `#amet`
__Now__: auto anchor is `#lorem-ipsum-dolor-sit-amet`
@d3m1d0v d3m1d0v force-pushed the fix-anchor-autonaming branch from 9270bfc to 84ffa59 Compare March 4, 2024 13:20
@d3m1d0v d3m1d0v added the bug Something isn't working label Mar 4, 2024
@d3m1d0v d3m1d0v merged commit e3c725b into master Mar 5, 2024
1 check passed
@d3m1d0v d3m1d0v deleted the fix-anchor-autonaming branch March 5, 2024 11:44
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

Successfully merging this pull request may close these issues.

2 participants