I am using Google Go on Google App Engine. I save the string description in a structure in a datastore , for example:
type Foo struct{ Bar string }
This description includes html tags, for example:
<a href="/">Bar</a>
I want the html template include this description in the html file so that it is parsed as html. For instance:
<html><head><title>Title</title></head> <body>{{.Bar}}</body></html>
for analysis:
<html><head><title>Title</title></head> <body><a href="/">Bar</a></body></html>
but instead, I get something like this:
<html><head><title>Title</title></head> <body><a href="/">Bar's</a></body></html>
How can I make template correctly parse string into html link?
source share