HTML inside data not being recognized in partial

I am trying to load some data from a json file that has HTML in it and it is not rendering in a partial. Here is a simple example


"Text": "This is a <br />test"


{{ with index }}
  {{ .Text }}
{{ end }}

The value of “Text” shows on a the screen, but it looks like this on the page

This is a <br />test

I want the line break in there. I have unsafe set to true in my config, but am not sure how to handle this. Do I need to create another partial that wraps around the data I want to format as HTML?

Try using {{ safeHTML .Text }}

Go templates escape HTML by default as a security precaution.
In this case, the <br/> element is rendered as part of the string.

Also see: safeHTML | Hugo