cisagov / get.gov

The website for the .gov registry
https://get.gov
Other
13 stars 2 forks source link

Auto generate anchors without special characters #266

Closed abroddrick closed 1 month ago

abroddrick commented 3 months ago

Issue description

On get.gov, some of our in-page anchors we are manually removing special characters from urls when they appear in the corresponding header. Instead we should have our system auto-generate anchors without them containing special characters.

note: this was split from #241

Acceptance criteria

Additional context

11ty uses a package called markdown-it to generate HTML from our Markdown formatted content. The anchors are generated by a markdown-it plugin called markdown-it-anchor. We can configure that plugin https://www.npmjs.com/package/markdown-it-anchor#user-friendly-urls but it isn't immediately obvious from the documentation which option gets us the "no percent encoding" setup that we are looking for. https://11ty.rocks/eleventyjs/slugs-anchors/ is a blog post with more details on how to configure these things.

slack thread for context

Links to other issues

split from #241

Related to #255

abroddrick commented 3 months ago

Sigh, @h-m-f-t sorry I made this in the wrong repo

vickyszuchin commented 3 months ago

Accepted into the backlog. Suggested timeline: 2 sprints away (from sprint 41).

abroddrick commented 1 month ago

Closing as this was completed as part of the linkify ticket