pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

Duplicated anchors for h2 sections

Open froggleston opened this issue 1 year ago • 2 comments

Following updating from 2.0.9 to 2.1.0, we see duplicated anchor tags following h2 sections: image

We create anchors manually before the HTML is passed to pkgdown as we need to provide translated anchors: image

Would it be possible to add some kind of flag to tweak_anchors to tell pkgdown to ignore <section> objects? Or is there another way I can avoid the automated adding of anchors to sections?

froggleston avatar Jul 29 '24 14:07 froggleston

If you want to provide translated anchors, maybe that's something pkgdown should just do for you? It looks like you're only translating the word "anchor"?

hadley avatar Jul 29 '24 14:07 hadley

Hi @hadley thanks for your quick reply! No, we have a larger set of "core" translations that we apply to our lesson materials based on a configured two-letter language code: https://github.com/carpentries/sandpaper/blob/main/R/utils-translate.R

froggleston avatar Jul 29 '24 14:07 froggleston