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.

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

traviscarden’s picture

I 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. :)

heddn’s picture

Issue summary: View changes

added html5

sdrycroft’s picture

heddn’s picture

sdrycroft, 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.

hawkeye.twolf’s picture

RE: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 la drupal_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:

  // @EDIT CSS was getting added twice; use drupal_static() to prevent that.
  $already_run = &drupal_static(__FUNCTION__);
  if (isset($already_run)) { return; }
  $already_run = TRUE;

Hope that helps!
Derek

PS - I'd be happy to provide a patch against whichever branch would be most helpful - just give the word.

hawkeye.twolf’s picture

Issue summary: View changes

Formatted list.

hawkeye.twolf’s picture

Removed accidentally-added issue tag.

rob230’s picture

Is 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?

heddn’s picture

Issue summary: View changes
Issue tags: -

There isn't much difference between 1.x and 2.x.

2.x:

  • Libraries 2.x support
  • New method to build and provide default purifier configurations. Useful for distributions.
  • 2.x is the basis for the D8 port.
heddn’s picture

Status: Active » Fixed

I'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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.