[英]is it possible to process html to auto close tags with no close tags?
我有這串
<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>
我想隱瞞它
<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>
基本上,我想自動關閉任何非html已知的標簽,因為我在htmlagilitypack中處理此html時遇到問題,因為它會更改html的含義。
HTML(不是XHTML)已經做到了這一點:定義了自動關閉的標簽 ,而沒有結尾的結束符/
( <br>
)。
我不熟悉htmlagilitypack
,但是如果您基於HTML4.01制作自己的DTD(使用您自己的標簽進行擴展),則必須有一些可以使用的HTML解析器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.