xsleaks / wiki

XS-Leaks Wiki
https://xsleaks.dev
Apache License 2.0
138 stars 39 forks source link

Hints in Contribution section #148

Open terjanq opened 1 year ago

terjanq commented 1 year ago

Looks like hint boxes in Contribution section are broken.

image

aaronshim commented 8 months ago

This has been a problem since the v0.100 release of Hugo (I found it by bisecting known-good versions.) The likely cause is their attempted implementation of https://github.com/gohugoio/hugo/issues/6703, which affects both markdownify and .Page.RenderString. The original authors of the book theme also ran into this problem at https://github.com/alex-shpak/hugo-book/issues/452, which they solved with https://github.com/alex-shpak/hugo-book/commit/6e1b44c4c4654d8abb8c534b50869c754b8cad27.

This issue is also mentioned in https://github.com/xsleaks/wiki/pull/152.

My best attempt is to do a similar escape sequence as https://github.com/alex-shpak/hugo-book/commit/6e1b44c4c4654d8abb8c534b50869c754b8cad27 (many other escape sequences, even safeHTML, do not work, as the final markdownify will attempt to render the {{< hint >}} shortcode regardless of what surrounds it), but it renders some of the extra escape sequences on the page, so we do have to do a bit of replace magic to get it back out.