Hello Everyone,
I am trying to add some content to wikitext on 'Save'. The formatting blows
up when i refresh the page.
Example: the h2 header now shows as the following after doing
$element[$i]=$element[$i]." a "
== Call Info == a
*I am using the hook ArticleSave. It seems if i add spaces, newlines it
works. but when i add any text it blows up.*
Pls find the code snippet.
*/**
*adding on the hook $wgHooks['ArticleSave'][] = 'functionA';*
*function functionA(&$article, &$user, &$text, &$summary, $minor, $watch,
$sectionanchor, &$flags)*
*$element=explode("\n",$text)
for loop
$element[$i]=$element[$i]." " // this works
$element[$i]=$element[$i]." \n\n " // this works
$element[$i]=$element[$i]." a " // this does not *
**/*
*Possible problem area*: it seems the problem is with the Parser.php in the
doHeadings function where a regular expression is been checked. Once the
text
is added seems the parser does not recognise it as header anymore.
It will be nice if someone can provide help on this.
Thanks
--Viral