Html cleaner alternative

I want to accept, to accept the html input from the user and publish it on my site, I also want to make sure that it does not create a problem with my site template due to the dirty html code.

I have used the html cleaner in the past, but the Html cleaner does not work on one of my servers. Therefore, I am looking for a better alternative. What is written in php. which can fix dirty html code like

</div> it is dirty code as div is closed without opening. 
+3
source share
3 answers

You can try PHP Tidy , which is a Tidy library in PHP.

+4
source

: DOMDocument loadHTML . <html> <body>, . , , HTML.

, , . URL-, , , http:, , javascript:. , , ( - , ).

, node , saveHTML. DOM, - , , .

+4

, Tidy , , HTML Purifier, , (, JavaScript onclick events ..).

Remember that Tidy requires libtidy to be installed on your server, so this is not just direct PHP.

I know that PΓ‘draic Brady is working on an alternative to HTML Purifier for the Zend Framework, although I think its just experimental code at this time

http://framework.zend.com/wiki/pages/viewpage.action?pageId=25002168

http://github.com/padraic/wibble

0
source

Source: https://habr.com/ru/post/1772011/


All Articles