@Jura since the Github Issue is unassigned and you’ve also helped me a lot in the past.
Here is how to do a multiple replace
for these IDs. It’s an old trick involving dict
{{ $pairs := (dict "#net" "#.net" "#hello-bye" "#hello--bye") }} {{ $.Scratch.Set "specialTOC" .TableofContents }} {{ range $key, $val := $pairs }} {{ $.Scratch.Set "specialTOC" (replace ($.Scratch.Get "specialTOC") $key $val) }} {{ end }} {{ $.Scratch.Get "specialTOC" | safeHTML }}
This is battle tested and I’ve used it for my own mischievous purposes before Page Bundles became available.
The dict
can have as many pairs as you need. You can modify it as you need. If you run into any issues just post them here.
Hope this helps until/if there is another kind of fix.