How to check if a string contains or only contains numerical values

Hi, I want to imitate footnotes for some links.
Ideally I would add attributes but it hasn’t yet entered commonmark (if it ever does…) so I’ll use the renderhook instead. to get something like:

essayez ce lien1

But without having to write html, because it sucks. I just need a function or way to check if .Text contains only figures, to suround it with <sup></sup> and other attributes.

{{ if findRE `\d` $val }}
  contains one or more digits
{{ end }}

{{ if findRE `^\d+$` $val }}
  only contains digits
{{ end }}
1 Like

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