Detecting unicode ranges in content

I have a font I use for a handful of symbols. I’d like to preload the font only on pages that actually need it.

The symbols are all in the private use block. In theory I can detect uses by running a regex against the page content

{{ strings.FindRE "\\p{Co}" .Page.Content }}


{{ strings.FindRE "[\\x{e000}-\\x{f8ff}]" .Page.Content }}

This works for unicode escapes in markdown , but does not work on escapes rendered from within a shortcode. Because the symbols are used in a list and hugo doesn’t support adding attributes to list items in markdown I have to use a shortcode to write the html explicitly

{{< about-links.inline >}}
<ul class="about-link-container">
		<a href="" title="RSS" style="background-color: #ee802f80;">
		<a href="" title="GitHub" style="background-color: #6e549480;">
{{< /about-links.inline >}}

How can I detect specific unicode code points both in markdown and shortcodes? Can I force the shortcode to render unicode escapes the same way markdown seems to?

Hah, figured it out as soon as I posted. htmlUnescape will do the trick

{{ strings.FindRE "\\p{Co}" (.Page.Content | htmlUnescape) }}