我正在加载一个包含换行符的文本文件,并将其传递给html/templates.
html/templates
在加载的字符串中替换\nwith <br>,它们将被模板转义为html <br>并显示在浏览器中,而不是导致行返回.
\n
<br>
<br>
如何在不切换到text/templates(没有XSS保护)的情况下更改此行为?
text/templates
html templates go
go ×1
html ×1
templates ×1