[v0.70] Unexpected bad character U+00A0 in command

Hi, I created this shortcode : https://doc.huc.fr.eu.org/en/web/hugo/hugo-shortcodes/#manpage

If I modify to add a third argument, as:

{{ $txt := .Get 0 | safeHTML }}{{ $nb := .Get 1 | safeHTML }}{{ $anchor := .Get 2 | anchorize }}
<a class="man" href="https://man.openbsd.org/{{ $txt }}{{ if $nb }}{{ print "." $nb }}{{ end }}{{ if $anchor }}{{ print "#" $anchor }}{{ end }}" title="{{ i18n "manpageTitle" }}{{ $txt }}">{{ $txt }}{{ if $nb }}{{ print "(" $nb ")" }}{{ end }}</a>

I obtain this surprising error:

I dont understand the reason! Why?


Actually, I run Hugo:

$ hugo version
Hugo Static Site Generator v0.70.0/extended linux/amd64 BuildDate: 2020-05-09T11:54:44Z

What do you get when you run this?

grep --color='auto' -P -n "[\x80-\xFF]" "/path/to/shortcode.html"

https://stackoverflow.com/questions/3001177/how-do-i-grep-for-all-non-ascii-characters

2 Likes
$ grep --color='auto' -P -n "[\x80-\xFF]" man2.html
2:<a class="man" href="https://man.openbsd.org/{{ $txt }}{{ if $nb }}{{ print "." $nb }}{{ end }}{{ if $anchor }}{{ print "#" $anchor }}{{ end }}" title="{{ i18n "manpageTitle" }}{{ $txt }}">{{ $txt }}{{ if $nb }}{{ print "(" $nb ")" }}{{ end }}</a>

OK. Welldone! Thanks. :smiley:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.