[英]is it possible to process html to auto close tags with no close tags?
i have this string 我有这串
<div>
<p><strong>Elem_A</strong>String_A2_2 <String_A2_2> asdas</p>
<p><strong>Elem_B</strong>String_B2_2 String_B2_2</p>
</div>
and i want to covert it to 我想隐瞒它
<div>
<p><strong>Elem_A</strong>String_A2_2 <String_A2_2/> asdas</p>
<p><strong>Elem_B</strong>String_B2_2 String_B2_2</p>
</div>
basically i want to autoclose any non html known tag , because i have problems with processing this html in htmlagilitypack as it changes the meaning of the html. 基本上,我想自动关闭任何非html已知的标签,因为我在htmlagilitypack中处理此html时遇到问题,因为它会更改html的含义。
HTML (meaning not XHTML) already does this: auto closed tags are defined without a trailing closing /
( <br>
). HTML(不是XHTML)已经做到了这一点:定义了自动关闭的标签 ,而没有结尾的结束符
/
( <br>
)。
I'm not familiar with htmlagilitypack
, but if you make your own DTD based on HTML4.01, extended with your own tag, then there must be some HTML parser that can work. 我不熟悉
htmlagilitypack
,但是如果您基于HTML4.01制作自己的DTD(使用您自己的标签进行扩展),则必须有一些可以使用的HTML解析器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.