HTML Purifier

- Added support for Joomla 1.6
- Added support for translations
----------------------------------
Update 19 October 2010:
- Upgraded HTML Purifier version to latest available (v4.2.0).
- Added a switch to activate the built in cache of HTML Purifier (now active by default).
- The issues with the target attribute of links should be fixed
- The plugin information page has been moved to my new blog http://nemesisdesign.net/
Feel free to comment or email me to ask questions or collaborate with your code.
----------------------------------
Update 28 April 2009: corrected a little bug reported by a user.
I will try to spend some time soon updating the library version.
----------------------------------
This plugin is based on the HTML Purifier library ( http://htmlpurifier.org/ ), and has been ported to joomla by http://www.joomlashow.it/ staff.
This plugin purifies html code of contents to gain valid XHTML.
It's just 0.2 version but we want to make a well-working extension, our goal is to make possible a total xhtml 1.0 strict compliance with joomla 1.5.
We need help testing and getting feedback.
There are 4 versions available:
Html purifier Mambot - Joomla 1.0 - PHP 4 based on 2.1.3 version of the HTML Purifier library;
Html purifier Mambot - Joomla 1.0 - PHP 5 based on 3.0 version of the HTML Purifier library;
Html purifier Plugin - Joomla 1.5 - PHP 4 based on 2.1.3 version of the HTML Purifier library;
Html purifier Plugin - Joomla 1.5 - PHP 5 based on 3.0 version of the HTML Purifier Library;
Plugin allows configuration of the following parameters:
Tidy Level: High, Medium, Heavy;
Doctype: Xhtml 1.0 Transitional, Xhtml 1.0 strict, Html 4.0 Transitional, Html 4.0 Strict;
Linkify: converts automatically every strings http: // in a link.
Trusted HTML: if setted "no" it doesn't permit to use script and style tags.
Proprietary CSS (PHP 5 only): if setted "on" permits to use of non standard css properties.
If you have some problems in a particular content item you can deactivate the plugin simply writing {disablepurifier}.
And don't forget to thank Edward Z. Yang for the library!
ADD:
Thank you for your appreciation.
I noticed a little problem on a site of mine, the plugin cutted the apostrophes, but really don't know why only on that site.
Anyway if you find problems please report!
This module is Joomla 1.5 also compatible.
When you enable the HTML purifier and click the thumbnails they open in an old fashioned way and no longer in a lightbox.
You can, however, add the {disablepurifier} in "classes" of the images advanced tab in the image editor but this is not a good fix as it would require me to go through hundreds of images and in addition the website will no longer pass the W3C validator.
This involved swapping out the "library" folder in the htmlpurifier plugin directory tree with that found in v3.3.0 of HTML Purifier Lite, available here:
http://htmlpurifier.org/releases/
The required additions to htmlpurifier.php are described below:
http://htmlpurifier.org/phorum/read.php?3,2720
In particular you need to add these lines before the line "purifier = new HTMLPurifier($config);"
// retain anchor links
$config->set('HTML', 'DefinitionID', 'enduser-customize.html tutorial');
$config->set('HTML', 'DefinitionRev', 1);
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
Also, to avoid some PHP warnings, you will need to change these lines in htmlpurifier.php:
$config->set('Core', 'DefinitionCache', null);
$config->set('HTML', 'EnableAttrID', true);
To these, respectively:
$config->set('Cache', 'DefinitionImpl', null);
$config->set('Attr', 'EnableID', true);
Thank you very much, there is something i didn't understand properly, can i contact you in private to ask you some questions?
My poor FAQ...
I've tried switching the purify to light mode with XHTML 1.0 Transitional and it still strips name from the anchor.
hey i just updated the plugin and that issue should be solved.
Let me know.
Federico






