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.
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.
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
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.
I obtained the string .replace("The escape character you set yourself or specified for newline", "nt");
json is just data, the front-end display is controlled by you
html automatic line wrapping just needs to be surrounded by p!
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.
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.
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
This is the escape agreed by the server and client, such as the agreed line break---"&br". . .
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.
Your json data format problem, please communicate with the backend about this aspect