Last modified: 2014-06-10 11:50:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 6812 - Requesting hook to affect preview text
Requesting hook to affect preview text
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Low enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: testme
Depends on:
Blocks: 5984
  Show dependency treegraph
Reported: 2006-07-25 05:20 UTC by Charlie Huggard
Modified: 2014-06-10 11:50 UTC (History)
7 users (show)

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


Description Charlie Huggard 2006-07-25 05:20:10 UTC
There are pages that I would like to write an extension to create custom display
wrappers for specific pages (i.e. syntax highlighting for source code articles),
however it's close to impossible to pull and wrap the preview text. 

by inserting: 
at line 1384 of EditPage.php, 1.8alpha (r15811), it would be possible to wrap
preview text with the same or similar wrappers as one would do on view or edit. 

This solves most of the problems for such an extension (see url). The only
remaining problem is how to implement the wrapper for when the cache occurs on
save without saving the wrapper in the database.
Comment 1 Scott Horlbeck 2008-07-24 15:49:19 UTC
I agree that this hook really needs to be added. FCKeditor, for example, extends the EditPage class and adds two custom hooks: 'EditPageBeforePreviewText' and 'EditPageBeforePreviewTextEnd', but extending the class isn't always an option, and I know my extensions would be so much easier to write/manage if these hooks were available. I am sad to see this was proposed in 2006 but nothing has been done about it still. With 1.13.0 almost out, I would be overjoyed to see it make it in there at the very last minute (but I won't hold my breath).
Comment 2 Sumana Harihareswara 2011-09-30 14:52:06 UTC
I'm getting a 404 when I visit -- therefore, removed the "patch" & "need-review" keywords.

Scott, Charlie, how do you feel about MediaWiki's current editor extensions?  Is this request still something you want/need?
Comment 3 Charlie Huggard 2011-10-13 00:18:07 UTC
To be honest Sumana, I haven't looked at the Mediawiki codebase too closely in almost 3 years now. I'm know it was something I really wanted between 1.8 and 1.13... but I could not say if it is still needed.
Comment 4 Scott Horlbeck 2011-10-13 16:03:50 UTC
Hi Sumana, sorry for the slow reply. I haven't been working on any Mediawiki projects for a long time now, but I do recall that it would have been very helpful to have that hook added. I jumped through a lot of hoops in order to implement a solution that COULD have been very quick and easy with this hook. So while I personally have no need for it now, I am sure there are other developers who would really benefit from it.
Comment 5 Technical 13 2014-03-01 20:58:20 UTC
Is this still an issue?  It has been years since there has been any comment here and I know a lot of things have changed from 1.19 to 1.22.
Comment 6 PiRSquared17 2014-04-27 02:03:22 UTC
(In reply to Technical 13 from comment #5)
> Is this still an issue?  It has been years since there has been any comment
> here and I know a lot of things have changed from 1.19 to 1.22.

Are these hooks sufficient:
* EditPageGetPreviewContent
* AlternateEditPreview
Comment 7 Andre Klapper 2014-06-10 11:50:43 UTC
No replies to comment 4 and comment 6, hence assuming that the hooks listed in comment 6 are sufficient.

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