Open xoxys opened 2 years ago
What's the right way to escape shortcode snippets while using RenderString?
The way you show above, but I suspect you have a case of "double rendering" of your markdown which would produce the situation you describe.
I suggest you take further trouble shooting at:
I'm reopening this as you may have a point that there is an issue worth fixing. I'm not sure what that fix should be so open to suggestions.
Details, including a workaround: https://discourse.gohugo.io/t/40292/4
Sorry, but it feels a bit odd how the project deals with reported issues sometimes...
I have reported the issue here, then the issue was closed pretty fast. As recommended, I have started a discussion on the forum (https://discourse.gohugo.io/t/escape-shortcodes-while-using-renderstring/39331). The issues were reopened because this seems to be a valid issue, but nobody has linked the forum discussion. Now another forum discussion was needed to notice that the problem with “that” is that it doesn’t yet provide any meaningful detail
?? That's a bit annoying, especially as nobody has ever again requested more details during the conversation... :shrug:
Sorry, but it feels a bit odd how the project deals with reported issues sometimes...
I apologize. We're short on staff, which means we need to be a little "over effective".
My 50 cents here:
RenderString
handles shortcode escapes (commenting out shortcodes) the same way as shortcodes inside content files.I understand that as well, no worries.
I suggest you start by looking into your own templates and make sure you don't do that.
As discussed on the forum, handling this in the theme isn't that simple in some situations as well. However, I can stick to the workaround from https://discourse.gohugo.io/t/escape-shortcodes-while-using-renderstring/39331/6 for now. Thanks for your work.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
In the past it was possible to escape shortcode syntax e.g. in a code block like this:
This snipped was rendered without issues while using
.RenderString
. With the current version of hugo this is no lomger possible and result in the following error:What's the right way to escape shortcode snippets while using
RenderString
?