Here’s the HTML I got from the interface:
<div style='font-size:50px; Color :#000000'> < BR > Since May 1, 2019, the reference range of serum creatinine (Crea) has been adjusted to < BR > Male: 57~97 (<60 years old); 57-111 (≥60 years old) < BR > Female: 41-73 (<60 years old); <p align=center> <p style=' FONT-SIZE :50pt; color:#0000FF; text-decoration:underline; "Href =" http://www.wwhospital.com/html/jyk_wxts.htm "> click to see more test/inspection related announcements < / a > < / p > < / div >Copy the code
Directly display it through the Rich-text Nodes attribute, as shown in the following figure:
The problem is that, except for the HTML tag, everything from the first “<” symbol is not displayed.
The solution to this problem is to escape the “<” symbol: <
Replace (/[<]/ig,'< ‘); The HTML tag will also be affected and the text will be completely messed up.
So we want to narrow the scope of escape, just need to escape the “<” symbol before the number.
Improved replacement method is as follows: HTML = HTML. Replace (/ [<] ([0-9])/ig, ‘& lt; $1 ‘);
Tramp tramp tramp ~~~
Finally, the desired effect comes out!!