Hi Thomas,
the text which is passed in the replaceVariables function is only the text
actually contained within the template (not the complete article with all
included templates), so it should be ok to have the same function call there
too...
On the other hand introducing a new hook call 'ParserBeforeStripTemplate' or
sth might be the safer way and wouldn't break existing extensions for sure,
and if you want template replacements too (which I'd reckon most extension
writers would want) you'd simply have 2 hook pointers pointing to the same
function 'My_ParserBeforeStrip'...
Cheers,
Peter.
On 10/27/07, Thomas Dalton <thomas.dalton(a)gmail.com> wrote:
A proposal for fix which allows also preparsing
for wikitext included in
templates (it works for me, but which you might want to review for
inclusion
in the main code):
original code:
function replaceVariables( $text, $args = array(), $argsOnly = false
) {
... snip code for readability ...
wfProfileOut( $fname );
return $text;
}
replace this with:
function replaceVariables( $text, $args = array(), $argsOnly = false
) {
... snip code for readability ...
wfProfileOut( $fname );
wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text,
&$this->mStripState ) );
return $text;
}
I think it should be a new hook, not calling the existing hook again.
Having the existing hook called multiple times for one page could
easily break extensions.
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/wikitech-l