When using golang for web development, sometimes the rendered template will appear some strange blank line wrapping when it is displayed in the foreground. The specific feature is to check the blank part of CSS style sheet that has no relevant definition.
Check the source code of the page in question, copy the blank line feed part and transcode it to Unicode code, and find that it contains
\u2028Such characters [figure 1].
In addition, you can directly check the HTML in the browser and select edit as HTML. You can also find that there is a small red dot in the blank. When you move the mouse, it will directly show that the character is
In the web page inspection, you can find that deleting these red dots directly can solve the problem. There is a way of direct front-end processing on the Internet, that is, searching the
\u2028And replace it with
\\u2028You can, of course, use golang in the background to process, that is, you can retrieve and replace the content before outputting HTML.
Well, the above is the whole content of this article. I hope it can help your study and work. If you have any questions, please leave a message.