EMH333 / EMH_Website

My website
https://www.ethohampton.com/?utm_source=github&utm_medium=link&utm_campaign=github
0 stars 0 forks source link

Fix sanitization of text for JSON #24

Open EMH333 opened 4 years ago

EMH333 commented 4 years ago

Currently ', - and " will get sanatized when outputting to the SEO JSON. Should use https://gohugo.io/functions/htmlescape/ to fix it.

EMH333 commented 4 years ago

I believe this is fixed. Hugo treats ld+json as javascript so for it to properly (not) escape it, just remove the quotes, so

"url": "{{ .url }}",

becomes

"url": {{ .url }},