Replace .Text ' ' 'X' doesn't replace the space

I justice found out {{ $text := replace .Text ' ' '␣' }} and {{ $text := replace .Text " " '␣' }} produce different results. Only the second does anything.
Looks like a bug, no ?
Rectification: using {{ $text := replace .Text " " ‘␣’ }} ends up producing 9251, only double quotes around both arguments has the intended result. What is this…
I’m raising an issue.

We don’t use single quotes in any of the template examples in our documentation, and there’s a reason for that.

I just added this section to the templating documentation:
https://gohugo.io/templates/introduction/#quote-characters

1 Like