GenderDysphoria/GenderDysphoria.fyi

Some header permalinks do not work

the-blank-x opened this issue · 2 comments

Examples

Additional information

Here, the link that the anchor points to is specifically set, instead of the ID of the header tag that it links to.

.use(mAnchor, {
permalink: mAnchor.permalink.linkInsideHeader({
class: 'header-link',
symbol: '<img src="/images/svg/paragraph.svg">',
renderHref: (input) => '#' + slugify(decodeURIComponent(input)),
ariaHidden: true,
}),

A more proper solution (and thus fix) is to set the slugify parameter, as shown:

    .use(mAnchor, {
      slugify,
      permalink: mAnchor.permalink.linkInsideHeader({
        class: 'header-link',
        symbol: '<img src="/images/svg/paragraph.svg">',
        ariaHidden: true,
      }),
    })

I am slightly reluctant to make a pull request since I don't know why there is decodeURIComponent(input), hence this issue.

Hmm. The decode uri was added to address a similar issue, but I don't remember specifically which headers were causing the problem. See commit d542e8b