readFile equivalent without html escaping?

I have some SVG files that I want to reference rather than duplicate in a partial. readFile would be awesome if it didn’t html escape the contents of file. Any hints?

Haven’t tested it with SVG files, but the safeHTML function should mark a string as ‘safe’ HTML and prevent escaping.

If that doesn’t help, there’s also a htmlUnescape function that returns a string with HTML code unescaped.

So I’d tie one of those functions to your readFile output and see what happens. :slight_smile:

1 Like

Yes

{{ readFile “somefile.txt” | safeHTML }}

Should to it.

Thankyou!