mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
[1.7.0] Update INSTALL and basic example to use the new APIs.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1120 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
12f73605a3
commit
b442d09ea6
16
INSTALL
16
INSTALL
@ -130,13 +130,15 @@ detailed lowdown on the topic.
|
|||||||
For those of you stuck using HTML 4.01 Transitional, you can disable
|
For those of you stuck using HTML 4.01 Transitional, you can disable
|
||||||
XHTML output like this:
|
XHTML output like this:
|
||||||
|
|
||||||
$config->set('Core', 'XHTML', false);
|
$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional');
|
||||||
|
|
||||||
I recommend that you use XHTML, although not as much as I recommend UTF-8. If
|
Supported doctypes include:
|
||||||
your HTML 4.01 page validates, good for you!
|
|
||||||
|
|
||||||
Currently, we can only guarantee transitional-complaint output, future
|
* HTML 4.01 Strict
|
||||||
versions will also allow strict-compliant output.
|
* HTML 4.01 Transitional
|
||||||
|
* XHTML 1.0 Strict
|
||||||
|
* XHTML 1.0 Transitional
|
||||||
|
* XHTML 1.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -184,8 +186,8 @@ If your website is in a different encoding or doctype, use this code:
|
|||||||
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
|
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
|
||||||
|
|
||||||
$config = HTMLPurifier_Config::createDefault();
|
$config = HTMLPurifier_Config::createDefault();
|
||||||
$config->set('Core', 'Encoding', 'ISO-8859-1'); //replace with your encoding
|
$config->set('Core', 'Encoding', 'ISO-8859-1'); // replace with your encoding
|
||||||
$config->set('Core', 'XHTML', true); //replace with false if HTML 4.01
|
$config->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
|
||||||
$purifier = new HTMLPurifier($config);
|
$purifier = new HTMLPurifier($config);
|
||||||
|
|
||||||
$clean_html = $purifier->purify($dirty_html);
|
$clean_html = $purifier->purify($dirty_html);
|
||||||
|
@ -8,8 +8,8 @@ require_once '../../library/HTMLPurifier.auto.php';
|
|||||||
$config = HTMLPurifier_Config::createDefault();
|
$config = HTMLPurifier_Config::createDefault();
|
||||||
|
|
||||||
// configuration goes here:
|
// configuration goes here:
|
||||||
$config->set('Core', 'Encoding', 'ISO-8859-1'); //replace with your encoding
|
$config->set('Core', 'Encoding', 'UTF-8'); // replace with your encoding
|
||||||
$config->set('Core', 'XHTML', true); // set to false if HTML 4.01
|
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); // replace with your doctype
|
||||||
|
|
||||||
$purifier = new HTMLPurifier($config);
|
$purifier = new HTMLPurifier($config);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user