dongyi2534
dongyi2534
2016-08-06 12:26

如何在Golang模板中打印换行? [重复]

  • html
  • mysql

This question already has an answer here:

I have stored some content in MySQL that looks like this.

"Hi!
How are you?
Here is the link you wanted:
http://www.google.com"

When I print it in Golang template, its not parsing correctly. I mean everything displayed in one line.

Its supposed to print like this

Hi!
How are you?
Here is the link you wanted:
http://www.google.com

Here is my template code.

<tr>
    <td>TextBody</td>
    <td>{{.Data.Content}}</td>
</tr>

Am I missing something?

</div>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐