With the release of 7.x-1.0, now is the time to start a roadmap for 2.0. Here's some ideas from the issue queue. Please add other suggestions and help weight these features so so we can start creating patches and get it moving. I don't know how all these things should look/feel, so please provide input.
- Libraries 2.0 support - #1716936: Error if libraries location used, but libraries module not enabled
- Investigate ways to re-add support for csstidy - #1817412: ExtractStyleBlocks requires invalid module
- UX - #925300: Give better information about what HTML is allowed & #925310: Configuration page should have inline examples
- HTML5 - #1321490: HTML5 Support?
The one about user experience really needs help. Spec compliant HTML and stripping out based on regex can be complex. From the "WYSIWYG" consumer perspective, are there better ways to utilize hook_filter_FILTER_tips()? In other words, people need to know what is appropriate HTML to use in a "WYSIWYG".
Comments
Comment #1
traviscarden commentedI realize this is something that must be added upstream in the library itself, but I'll propose it here in case anyone has the interest or resources to help with it: Add HTML5 support. This could be a deal breaker for a lot of folks (it will be for me), so if there's to be a big thrust for a 2.x, it should probably be at least considered. :)
Comment #1.0
heddnadded html5
Comment #2
sdrycroft commentedComment #3
heddnsdrycroft, is this really something that the Drupal module can do? I suggest that it is really something that should be taken up with the maintainers of the library on htmlpurifier.org. ezyang does a great job with the library, but HTML parsing by library will consume CPU if the HTML is complex. With that said, let's keep the performance footprint of the drupal module as small as possible.
Comment #4
hawkeye.twolfRE:item "Investigate ways to re-add support for csstidy", I wanted to provide my solution for adding support in the 1.x branch.
With the latest CSSTidy source downloaded to your libraries folder and the ExtractStyleBlocks configuration option enabled, the "please install CSSTidy module" warning goes away. To insert the extracted CSS, you must use the Drupal 7 equivalent of hook_nodeapi, hook_node_view. Interestingly, the legacy hook_nodeapi code is actually still present in the 7x-1x branch.
Two modifications are needed to _htmlpurifier_add_css(). First, the preg_match regex pattern must be updated to support Drupal 7's multilingual field arrays. Simply add support for an extra level of nested array, so that
#<!-- HTML Purifier Cache \#([-\w]*:[\w]*) -->#becomes#<!-- HTML Purifier Cache \#([-\w]*:[\w]*:[\w]*) -->#. Next replace drupal_set_html_head() with drupal_add_css(), a ladrupal_add_css($style_rendered, array('type' => 'inline'));. It may also be possible to use the Drupal 7 equivalent of drupal_set_html_head, drupal_add_html_head, but I believe drupal_add_css is better practice.Since I am using Panels to override the default node output, I actually had to use hook_ctools_render_alter instead of hook_node_view to insert the extracted CSS. And that hook seemed to be getting called twice per page view, so I added a call to drupal_static to prevent the CSS from getting inserted twice:
Hope that helps!
Derek
PS - I'd be happy to provide a patch against whichever branch would be most helpful - just give the word.
Comment #4.0
hawkeye.twolfFormatted list.
Comment #5
hawkeye.twolfRemoved accidentally-added issue tag.
Comment #6
rob230 commentedIs there any news around the 2.x branch?
The 1.0 release is around a year and a half old now, but as I understand, it doesn't have many bugs and is in use on many sites.
What does the 2.x branch bring, and is there a stable release on the horizon?
Comment #7
heddnThere isn't much difference between 1.x and 2.x.
2.x:
Comment #8
heddnI'm going to mark 2.x as complete. Next week we are going to have a sprint to port htmlpurifier to D8. So most of the future emphasis for htmlpurifier is getting ready for an 8.x release.