DOM parser that allows HTML5-style </ in [removed] tag

后端 未结 6 1197
無奈伤痛
無奈伤痛 2020-11-28 06:14

Update: html5lib (bottom of question) seems to get close, I just need to improve my understanding of how it\'s used.

I am attempting to

6条回答
  •  离开以前
    2020-11-28 07:11

    I had the same problem and apparently you can hack your way trough this by loading the document as XML, and save it as HTML :)

    $d = new DOMDocument;
    $d->loadXML('');
    echo $d->saveHTML();
    

    But of course the markup must be error-free for loadXML to work.

提交回复
热议问题