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为

<hr />
自闭和,使用 suppressEmptyNode可以实现,但是你需要注意的是,必须是没有targetValue
innerHtml br的问题
innertHtml有时会返回


<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