Last modified: 2012-07-05 14:36:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36678, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34678 - New Hook: "InternalParseBeforeSanitize"
New Hook: "InternalParseBeforeSanitize"
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.19
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-24 04:56 UTC by Daniel A. R. Werner
Modified: 2012-07-05 14:36 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
adds a new hook 'InternalParseBeforeSanitize' to the parser (795 bytes, patch)
2012-02-24 04:56 UTC, Daniel A. R. Werner
Details
equal to previous patch but with hooks documentation updated (1.90 KB, patch)
2012-02-25 03:06 UTC, Daniel A. R. Werner
Details

Description Daniel A. R. Werner 2012-02-24 04:56:54 UTC
Created attachment 10085 [details]
adds a new hook 'InternalParseBeforeSanitize' to the parser

I am in need for a new hook, making it possible to change parser output before it goes to the sanitizer. This is the second extension I am working on which would profit from this.
The first time I was able to build around this by using 'InternalParseBeforeLinks' hook, calling Sanitizer::removeHTMLtags() manually on the newly inserted stuff. Now I had to run the whole sanitizer on the whole text for a second time.

I guess calling the sanitizer just once would be faster and the new hook would be more suitable for extension development. One suitable name could be 'InternalParseBeforeSanitize'. See my patch for details.
Comment 1 Sam Reed (reedy) 2012-02-24 16:39:38 UTC
You should also add this hook to doc/hooks.txt
Comment 2 Daniel A. R. Werner 2012-02-25 03:06:54 UTC
Created attachment 10095 [details]
equal to previous patch but with hooks documentation updated

Thanks Reedy, I wasn't aware of that list. I will also create the hooks documentation on mediawiki.org as soon as it's implemented.
Comment 3 Sumana Harihareswara 2012-05-25 02:54:40 UTC
Daniel, would it be reasonable for you to submit this into Gerrit?
Comment 4 Daniel A. R. Werner 2012-05-26 00:36:14 UTC
Sure Sumana, almost forgot about this since I am not working on these extensions currently but I'll submit it soon.
Comment 5 Daniel A. R. Werner 2012-06-24 20:45:55 UTC
Submitted for review in If32053f9304088d7943aa0c9e78716a644c34fe1
Comment 6 Daniel A. R. Werner 2012-07-05 14:36:19 UTC
Merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links