我的问题是个特例。
首先,
仅限<p>
tags 而不是其他标签。 因此,你不需要担心任何其他方面。
我有一份是一份软件产出的html文件,但有一些错误,如无封闭的<代码><p> tag。
eg. I have taken all document in a string
我的文件就是这样。
<html>
....
....
<head>
</head>
....
....
<body>
...
...
<p> // tag is to be removed as no closing tag
<p align="left"> AAA </p>
<p class="style6"> BBB </P>
<p class="style1" align="center"> CCC </P>
<p align="left"> DDD // tag is to be removed as no closing tag
<p class="style6"> EEE // tag is to be removed as no closing tag
<p class="style1" align="center"> FFF // tag is to be removed as no closing tag
<p class="style15"><strong>xxyyzz</strong><br/></p>
<p> // tag is to be removed as no closing tag
<p> stack Overflow </P>
<body>
</html>
tags with DDD,EEE,FFF and unclosed <p>
tag are to be removed
As you can see it should work for every unclosed <P>
tag whether it is having attributes like class or align.
我还想提到,没有<代码><p> tag within another <p>
tag ,i
<p>
<p>
</p>
<p>
</p>
</p>
这种情况永远不会发生。
我尝试利用区域执法和安全局,但不能得到完美的回答。
为那些将提供帮助的人预示了许多事。
关于