I’m having an issue with shortcode that uses strings.ReplaceRE; the replacement output is quoted, and therefore not interpreted as html. I can’t find a way to drop the quotes.
The shortcode in conversation.html
:
{{ replaceRE `\*\*([AB])\*\*\: (.*)` "<p><strong>Message from $1:</strong><br />$2</p>" .Inner }}
Sample input:
{{<conversation>}}
**B**: Hello.
**A**: A: Hi there! How's it going?
{{</conversation>}}
Actual output:
A text element wrapped in quotes
Expected output:
HTML code that’s not wrapped in quotes.
I’d love to hear your feedback on my usage of ReplaceRE.
I searched this forum and found a similar issue: .Get returns string with double quotes - support - HUGO (gohugo.io), however, whether or not the shortcode includes any HTML tag, or not at all, the result of replaceRE is still wrapped in quotes. Also, this issue happens regardless of whether the REPLACEMENT is wrapped in “quotes” or backticks
.