【发布时间】:2015-03-02 18:12:53
【问题描述】:
有没有办法可以删除其中没有文本但可能包含空 html 标签的段落?
例如
<p><strong><br></strong></p> or <p></p> or <p> </p>
将被删除,但
<p><strong>hi<br>there</strong></p> or <p>hi there</p>
不会被删除
【问题讨论】:
-
使用 tidy 怎么样? tidy.sourceforge.net
标签: javascript php regex preg-replace