How to avoid HTML entities in CSV?

Hey guys,

For a project I wanted to use content from CSV files and I use this code:
`
{{ $url := “data/1-Documents-2015-12-05.csv” }}
{{ $sep := “;” }}
{{ range $i, $r := getCSV $sep $url }}

{{ index $r 0 }} {{ index $r 1 }} {{ index $r 2 }} {{ index $r 3 }} {{ index $r 4 }} {{ index $r 5 }} {{ end }} ` So I print a table from csv content. In the CSV i have some signs like "<" and ">", but when loading it in Hugo it gets replaced by HTML entities like this: en <img src="//domain.net/flags/gb.png">

In a browser this won’t show the image, but the plain text url. Can I somehow omit to replace that those characters?

Help would be much appreciated.

Cheers,
z0rg

Pipe it to safeHTML in the template.

<td class="column-1">{{ index $r 0 | safeHTML }}</td>
1 Like

Wow thank you so much @moorereason!! Working just fine.