note 114456 added to tidy.examples.basic
| From: | gk at anuary dot com | Date: | Sat, 22 Feb 2014 22:56:32 +0000 |
| Subject: | note 114456 added to tidy.examples.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198592@lists.php.net to get a copy of this message | ||
If you are looking for HTML beautifier (a tool to indent HTML output produced by your script), Tidy
extension might not be the right tool for the job.
First and foremost, you should not be using either Tidy or alternatives (e.g. HTML Purifier) in the
production code. HTML post procession is relatively resource demanding task, esp. if the underlying
implementation relies on DOM API. However, beyond performance, HTML beautification in production
might hide far more serious output issues that will be hard to trace back, because output will not
align with the input.
If you are indenting to use indentation (consistent, readable formatting of the output) for
development purposes only then you might consider implementation that relies on regular expression.
I have written, https://github.com/gajus/dindent for
this purpose. The difference between earlier mentioned implementation and the latter is that regular
expression based implementation does not attempt to sanitise, validate or otherwise manipulate your
output beyond ensuring proper indentation.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/tidy.examples.basic.php
Edit -- https://master.php.net/note/edit/114456
Del: integrated -- https://master.php.net/note/delete/114456/integrated
Del: useless -- https://master.php.net/note/delete/114456/useless
Del: bad code -- https://master.php.net/note/delete/114456/bad+code
Del: spam -- https://master.php.net/note/delete/114456/spam
Del: non-english -- https://master.php.net/note/delete/114456/non-english
Del: in docs -- https://master.php.net/note/delete/114456/in+docs
Del: other reasons-- https://master.php.net/note/delete/114456
Reject -- https://master.php.net/note/reject/114456
Search -- https://master.php.net/manage/user-notes.php