fast-xml 使用心得 #481
tidys
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
自闭和标签的注意事项
我想要build result中hr为
![image](https://user-images.githubusercontent.com/7894208/182775179-a90a76ad-22f5-4975-a61b-35acf5cf3214.png)
<hr />
自闭和,使用 suppressEmptyNode可以实现,但是你需要注意的是,必须是没有targetValue
innerHtml br的问题
innertHtml有时会返回
![image](https://user-images.githubusercontent.com/7894208/182777802-d69c9696-4be9-4ae6-9284-e20b99dc38ac.png)
![image](https://user-images.githubusercontent.com/7894208/182778168-f6622e37-4f2b-4d82-b25f-2536f0d6240a.png)
<font size="20">1<br>2<br>3</font>
,没有自闭和直接parse就会导致将text解析到br标签里面
如果在build之后,就会变为
<font size="20">1<br>2</br><br>3</br></font>
不符合预期,从源代码看,好像也没有好的解决方案,只能在parse之前
replace(/<br>/g, '<br/>');
Beta Was this translation helpful? Give feedback.
All reactions