I have some data given to my template using Go that contains html tags. When I try to display this data, it displays the full text literally, including the HTML tags. Here's the code:
In my .tmpl
, I am looping through an object called .SimRpms
whose {{ $value }}
has html in it like <br>
:
{{ range $key, $value := .SimRpms }}
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">{{ $key }}</div>
<div class="panel-body">{{ $value }}</div>
</div>
</div>
{{ end }}
However when I look at the rendered page, the {{ $value }}
is rendered as plain text instead of html:
How can I get {{ $value }}
to interpret the text as HTML?
Here's what it looks like in the JS Console:
I know this is similar to this question: Golang html output is being interpreted as plain text instead of being received as html however the rest of the page is displaying HTML ok and the content type of the entire page has been set already, but this little panel isn't displaying the HTML (it's displaying it literally).