伊谢尔伦2017-04-17 17:40:58
I obtained the string .replace("The escape character you set yourself or specified for newline", "nt");
怪我咯2017-04-17 17:40:58
json is just data, the front-end display is controlled by you
html automatic line wrapping just needs to be surrounded by p!
迷茫2017-04-17 17:40:58
This part really needs to be handled by yourself, unless the json data returned by the backend provides you with a list of the fields you need, which is very convenient to control.
PHP中文网2017-04-17 17:40:58
Multiply the width of each Chinese character by the number, and add a line break when it is larger than the screen width. The width of Chinese characters can be calculated based on the value of the textsize attribute.
PHP中文网2017-04-17 17:40:58
The json format does not have line breaks. The string enclosed by "" needs to be replaced with a line break escape character. When a general json tool converts a string to json, it will automatically convert the line break character into an escaped line break character, such as line feed and carriage return. The 2 special characters 0x0d 0x0a are automatically converted into the 4-character escape character rn. Generally, manual conversion is not required
黄舟2017-04-17 17:40:58
This is the escape agreed by the server and client, such as the agreed line break---"&br". . .
阿神2017-04-17 17:40:58
What you screenshot is equivalent to a string of HTML strings. Just escape special characters such as quotation marks and tabs and store it as data in JSON format. . Then when you want to use it, just get this string of data from JSON and output it in an HTML file.
伊谢尔伦2017-04-17 17:40:58
Your json data format problem, please communicate with the backend about this aspect