I think this is something to do with my local setup but I can’t get hugo to stop escaping the + char in HTML.
Even a minimal example taken from Hugo’s website theme:
Results in it being escaped:
<link rel="alternate" type="application/rss+xml" href="http://example.org/index.xml">
Exact same when printing just {{ .Lastmod }} for example, + is escaped.
<meta property=article:modified_time content="{{ .Lastmod }}">
Results in (bad time due to page not having a modified time):
<meta property=article:modified_time content="0001-01-01 00:00:00 +0000 UTC">
Any way to prevent + being escaped? I’ve tried multiple different varieties of safeHTML, htmlUnescape etc but can’t get it to print normally.
Steps to replicate:
- Setup minimal hugo website (eg
hugo new site .) - Add below snippet or anything that prints the
+char{{ range .AlternativeOutputFormats -}} <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}"> {{ end -}} - Build website and see that char is escaped
Hugo version: Hugo Static Site Generator v0.71.0/extended darwin/amd64 BuildDate: unknown (installed via homebrew)
Env: OSX Catalina 10.15.4