jan-xyz / hugo-module-img-srcset

A Hugo module to modify image Markdown tags to support srcsets
The Unlicense
12 stars 1 forks source link

Use .PlainText instead of .Text #3

Open schwukas opened 3 years ago

schwukas commented 3 years ago

I'm using this little module for my blog, but I feel like using .PlainText makes more sense than using .Text. .Text will always output HTML, so quotes will end up as HTML escape sequences, whereas .PlainText will keep everything as text, which in my opinion makes more sense for captions.

I can open a PR if you want to stick to "the process" but it's only five characters, so ... :smile:

schwukas commented 3 years ago

Sorry, that's not correct. I must have looked at the wrong place. However piping the text into the safeHTML function works well: <figcaption>{{ .Text | safeHTML }}</figcaption>

jan-xyz commented 2 years ago

Thanks for the suggestion, sounds like an easy enough change