Well, I’m not too sure how MediaWiki handles stuff like this, I don’t really use it that much.
But, here’s am example plugin - adapted from a plugin I wrote that needed to do something similar - which should get you started. Note that this plugin runs on the OnWebPagePrerender event, which means that the comments would be available in their original format to editors should they need to add/edit the quotes once the page was saved.
Because it runs during the page parsing process, I’ve used the following format for the quote matching (so it doesn’t clash with chunk parsing): {! Comment | Attribution !}
Anyway, here’s the code. Feel to modify to your needs:
/**
* Plugin: QuoteConvert
* Author: Garry Nutting
* Date: 07/07/07
*
* Event: OnWebPagePrerender
*/
$e = &$modx->Event;
// Only on this event
if ($e->name == 'OnWebPagePrerender') {
// regular expressions
$replace = '/\{\!(.*?)\|(.*?)\!\}/ims';
$with = '<blockquote><p class="quote">\1 - <span class="attribution">\2</span></p></blockquote>';
// do replacement
$modx->documentOutput = preg_replace($replace,$with,$modx->documentOutput);
}
Hope that helps,
Garry