Last modified: 2011-03-13 18:06:28 UTC
Created attachment 4833 [details] adds new hook to Sanitizer Overview: FCKeditor extension uses it's own parser in Ajax calls to convert wiki text into HTML. This customized parser actually simply extends MediaWiki parser by overriding original methods and modifies the way how text is parsed (e.g it does not perform template substitution, keeps HTML comments). There is one problem with templates (reported here: http://dev.fckeditor.net/ticket/2069). The problem: Suppose we have: {|{{Prettytable}} |- | {{Hl2}} | Cell 1 | {{Hl2}} | Cell 2 |} FCKeditor extension converts {{Prettytable}} to unique string identificator before sending text to internalParse(). This uniqueid is unfortunately later stripped by Sanitizer::fixTagAttributes(). I have already fixed the FCKeditor extension - adding SanitizerAfterFixTagAttributes hook allows me to add back required text to $attribs array, but the problem is that now users must apply manual changes in the MediaWiki core in order to have it fixed. It would be great if this hook (SanitizerAfterFixTagAttributes) could be added to the core in MediaWiki 1.13.
Created attachment 4834 [details] same as previous, corrected indentation
Fixed in r33726, r33725.
Reverted in r33747. This seems like a really bad place to put such a hook, and it's ugly and weird to boot.
Ok, how about adding a hook at the end of Sanitizer::setupAttributeWhitelist()? Does it sound better? It seems that this function is called only once by Sanitizer. Other users could possibly disallow some unwanted attributes with this hook. With this hook I could change the $whitelist array a little bit, add another "fake" attribute to each element and pass unique id of a template definition. All I need to do is to tell MediaWiki to not strip some fake attributes.
A basic issue is that this is some global state... are you conditionally switching in this hook conditionally for special processing or is it always going to go to general HTML output?
Yes, this is a hook that could be enabled only in specific cases (when ajax call is requested by FCKeditor and wfSajaxWikiToHTML command is executed), I must admit that didn't think about that. So, this hook wouldn't be used on each page request.
Assigned: Andrew. Hope he can bring this to a satisfactory close.
Reassigning to Wiktor.
Changing File/Repo ==> General/Unknown...definitely not a File/Repo issue.
Closing this bug as there doesn't seem to be a satisfactory resolution.