We have one plugin (mod_oucontent, not shared with the community) where HTML is output through format_text, including filtering, except that we don't want filter_urltolink to run. (Or rather, we want to be able to turn on filter_urltolink for our site, but we can't do that until we ensure that it does not affect mod_oucontent.) For added complexity, we currently use filter_glossary here, and we want that to go on working, which prevents fixes involving no-link tags.
So, how to do that? We can think of several ways, which either involve core changes, or are nasty. I was hoping that either someone would think of a better way that we have overlooked, or enough people would think that our core changes sounded useful that we could get away with making them.
A. Make our own filter plugin
We could make filter_urltolinkwithstrangeextraoulogic, which subclasses filter_urltolink, and adds some extra hacky if statements, probably based on global $PAGE or something. [We don't want to do this.]
B. Get mod_oucontent to automatically set up configuration in filter_active for each instance
So, when you add a new instance of our module, we automatically turn off the urltolink filter in that context. [We really don't want to do this.]
C. In mod_oucontent mess with the HTML so that the urltolink filter does not match
E.g. replace http with http before calling format_text. [This seems like a really bad idea too!]
D. Add a new option disablefilters to format_text
format_text takes a $options array with many options. We could add a new optional one 'disablefilters', and then when mod_oucontent calls format_text, it could pass 'disablefilters' => 'filter_urltolink'. [Does anyone else have a use case for this change?]
E. Pass more options from format_text to each filter, and change filter_urltolink to respond to a new option
At the moment, where format_text calls filters, it passes on two things:
'originalformat' => $format,
'noclean' => $options['noclean']
We could pass through more options (e.g., anything in pas in to $options where the array key starts with filteroption?) Then change the standard filter_urltolink respect some option like that, and then we can set that option in our calls to format_text. [Again, Does anyone else have a use case for this change?]
So, what do you think?