开发者

HtmlPurifier: Remove Ambiguous WhiteSpace?

Is it possible to remove ambiguous whitespace from a string containing html with HTMLPurifier? I wasn't able to find anything relevant in the documentation. I'm also open to other methods if they exist.

Example Input:

    Test Line1
<p>
    Test Line2</p>
<p>
    Line 3</p>

Optimal Output:

Test Line1<p>Test Line2</p><p>Line 3</p>

Thanks开发者_运维百科!!!!!!


Can regular expression help?

$text = preg_replace('/\s+/u', '', $text)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜