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

ezyang’s picture

Status: Active » Closed (won't fix)

(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.

Josh Benner’s picture

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

ezyang’s picture

Status: Closed (won't fix) » Active

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

ezyang’s picture

Title: Add AutoFormat.RemoveEmpty.RemoveNbsp » Alter hooks on configuration for advanced configuration
Version: 6.x-2.3 » 7.x-2.x-dev

Rename, also we're probably not going to implement this for the 6.x series.

heddn’s picture

Assigned: Unassigned » heddn
Status: Active » Closed (won't fix)

PMed requester. He found that using the custom function mentioned in initial post worked fine.

heddn’s picture

Assigned: heddn » Unassigned