I'm using Hugo shortcodes to generate HTML forms from JSON. I like to set HTML attributes dynamically, but was not able to do so because the attributes were replaced with "ZgotmplZ". The template functions safeHTML, etc. did not work.
After some research I found the template function "safeHTMLAttr", which was already implemented, but disabled, because the developer has seen no use case for it. See #347 (comment)
I have now enabled the function again, because it would be really useful for me. If you like to merge it, I could also write a test and improve the documentation.
All committers have signed the CLA.
I like this PR. We live in the Go Template world with it's features and quirks. We should give users the tools they need to build whatever they want.
I like it, too.
tpl: Enable safeHTMLAttr
See #2234 and #347
Ditto. :-) Looking back at #347, it seems silly to me that I would have been so overly cautious back then. So, let's merge it! It's long overdue.
Merged as c21e2b3 after amending the commit message per the contribution guideline.
Thank you for your contribution, @webguerilla!
@anthonyfok Thank you for merging, however I have not contributed much, just uncommented your work 😃
@webguerilla Thank you for your compliments! But the credit actually goes to @tatsushid who contributed this feature in the first place.