This is a creation in Article, where the information may have evolved or changed.
When using Golang for web development, sometimes rendered templates appear in front of the foreground with some strange whitespace wrapping, the specific feature is to view the CSS style sheet and there is no relevant definition of the blank part.
Analysis:
To view the page source code for the problem page, copy the blank wrap section transcoding to Unicode encoding, and find that it contains the characters "figure I" of \u2028 .
"Figure I"
In addition, directly in the browser to check the inside of the HTML select Edit as HTML, you can also find that there is a small red dot in the white space, the mouse pointer will directly show that the character is \u2028"figure two." Lookup data found that such line breaks are not supported in JavaScript.
"Figure II"
Workaround:
In the Web check can be found that the direct deletion of these red dots can solve the problem. There is a direct front-end processing on the web, that is, to search the page \u2028 and replace it with \\u2028 , of course, you can use the Golang in the background processing, that is, before the output of HTML to retrieve the content, and replace it.
Strings. Replace (HTML,"\u2028", "",-1)