|
Peter Nguyen
HTML5 Support?April 24, 2010 01:45AM |
|
Re: HTML5 Support? April 24, 2010 01:51AM |
Admin Registered: 6 years ago Posts: 2,630 |
|
Peter Nguyen
Re: HTML5 Support?May 06, 2010 04:09AM |
|
Re: HTML5 Support? May 06, 2010 04:21AM |
Admin Registered: 6 years ago Posts: 2,630 |
The first step is implementing the HTML5 parsing algorithm. I've done part of the work in html5lib, but of late the parser there has fallen out of date, and needs to be updated with the spec.
Then we need to make HTML Purifier use the html5lib parser. There's also a show-stopper bug, which is that there doesn't seem to be a good way of passing around XML namespace information from DOM.
|
Benjamin "balupton" Lupton
Re: HTML5 Support?June 13, 2010 12:12AM |
I too would like HTML5 support.
I'm already using the PH5P lexer as indicated I should use in the changelogs if I wanted HTML5 support, but alas it does not help.
I tried the following, but still no avail.
$Definition = $Config->getHTMLDefinition(true); $Definition->addElement( 'section', // name 'Block', // content set 'Flow', // allowed children 'Common' // attribute collection ); $Definition->addElement( 'header', // name 'Block', // content set 'Flow', // allowed children 'Common' // attribute collection );
|
Re: HTML5 Support? June 13, 2010 12:25AM |
Admin Registered: 6 years ago Posts: 2,630 |
|
Benjamin "balupton" Lupton
Re: HTML5 Support?June 21, 2010 02:09AM |
Hi Ambush,
Here is the configuration being used with HTML Purifier 4.1.1:
require_once(HTMLPURIFIER_PATH.'/HTMLPurifier.auto.php'); require_once(HTMLPURIFIER_PATH.'/HTMLPurifier/Lexer/PH5P.php');
$Config = HTMLPurifier_Config::createDefault();
$Config->set('HTML.AllowedAttributes', null);
$Config->set('AutoFormat.AutoParagraph', false);
$Config->set('AutoFormat.Linkify', false);
$Config->set('Core.LexerImpl', 'PH5P');
$Purifier = HTMLPurifier::getInstance();
$value = $Purifier->purify($value, $Config);
This will work fine, however it will turn:
<section class="section" id="step1"> <h1>1. Modifying nav.json</h1> ...
into:
<h1>1. Modifying nav.json</h1> ...
so it will strip all the html5 elements.
Hence my attempt to add them, via the configuration in my previous message.
|
Re: HTML5 Support? June 22, 2010 07:08PM |
Admin Registered: 6 years ago Posts: 2,630 |