Go template.ExecuteTemplate include html

后端 未结 8 1859
我在风中等你
我在风中等你 2020-12-01 10:19

I have followed this tutorial: http://golang.org/doc/articles/wiki/final.go and have slightly modified it for my needs/wants. The problem is I would like to support HTML in

8条回答
  •  有刺的猬
    2020-12-01 11:00

    In my case (where I am populating a view struct with a list of Activity), I had to change the property Message string to Message template.HTML. Then, when setting the property value I can call activity.Message = template.HTML("The HTML").

提交回复
热议问题