thegeeklab/hugo-geekdoc

XML not highlighted in the expand shortcode.

vhorvat opened this issue · 2 comments

Hello!
While using Hugo powered page for my personal project I use expand shortcode in conjunction with code highlighting function and if the code in the expand block is XML it’s not highlighted as it should be but parsed instead.

I figured out that if I remove htmlUnescape function from the expand shortcode, everything works fine.
My question is whether is this by design or is this indeed a bug since I don't really know the background why htmlUnescape is used here. If I choose any other programming language to be used for the highlighting inside expand shortcode everything works as regular.

Is there a different proposed way to use expand + highlight function while working with XML?

Thank you!

With unEscape function enabled:
Snimka zaslona 2023-07-11 130507

With unEscape function removed (and as it should be):
252644846-8197ffaa-4d7e-49e1-944e-a0da8f4d645e

Sample code:
https://gist.github.com/vhorvat/f5071d6e4b191d1829641772d94d959b

I use v115.2 of Hugo and latest Geekdoc version.

xoxys commented

Hi, thanks for your report. This workaround was introduced in #415, but I'm not able to reproduce the formatting issue anymore. I will remove htmlUnescape function from the short code for now.

Thank you for your fast reply!