Closed (won't fix)
Project:
HTML Purifier
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2010 at 17:13 UTC
Updated:
7 May 2012 at 11:05 UTC
For dealing with paste-from Word files, having AutoFormat.RemoveEmpty.RemoveNbsp would be very nice since word sometimes pastes empty paragraphs with a non-breaking space in them. I know this can be done in the custom function; however, for other reasons, the advanced configuration is not really an option.
Comments
Comment #1
ezyang commented(WONTFIXing for now; I'm not denying there is a problem to be fixed though).
The point of the basic configuration is that it is, well, basic, and I think RemoveNbsp is pretty not in that category. I'm more curious why advanced configuration is not an option: if it is not, we should fix that! For example, we could allow administrators to specify what subset of configuration options they want configurable from the config screen, a sort of config config.
Comment #2
Josh Benner commentedIn my scenario, advanced configuration is not an option because I am exporting input format configurations via the input_formats and exportables modules. This means that while the input formats usually have similar ID numbers, I cannot rely on the arbitrary format ID numbers being the same on each instance of the site. Because the PHP configuration function requires that the format ID be in the function name, I cannot take this approach.
In my opinion, a far better approach to advanced configuration would be this: Instead of using a function named using an arbitrary ID number, invoke an alter hook on the configuration (see http://api.drupal.org/api/function/drupal_alter/6). This way, you could have just one filter type (the basic), and modules could implement an alter hook which could make changes to the config before it is passed to the HTMLPurifier library.
If you are amenable to this approach, I would be willing to generate the patch. In doing so, I'd leave the current ID-in-function-name approach in place as well (though I'd recommend deprecating it and removing it in a subsequent release of the module).
Thoughts?
Comment #3
ezyang commentedThat's sounds great. I've never personally used the PHP configuration facilities, and put them in only because I know that there is some HTML Purifier configuration you can't do via the web forms.
Comment #4
ezyang commentedRename, also we're probably not going to implement this for the 6.x series.
Comment #5
heddnPMed requester. He found that using the custom function mentioned in initial post worked fine.
Comment #6
heddn