Page MenuHomePhabricator

Parser inserts <pre> on lines begining with space in raw html output from parser->setHook type hook.
Closed, DuplicatePublic

Description

Noticed in DynamicPageList extension. Bug appeared sometime after that extension was written, but before 1.15 was released (since 1.15 is earliest release I had installed to test with).

Consider the following code:

$wgHooks['ParserFirstCallInit'][] = 'testprefunc';
function testprefuncrender () {

return "This should be raw html! See <blink>no filtering</blink>.\n Oh look, there's a &lt;pre&gt;";

}
function testprefunc ($parser) {

$parser->setHook( 'pretest', 'testprefuncrender' );
return true;

}

When you put <pretest/> in a wiki page, this inserts the following html:

<p>This should be raw html! See <blink>no filtering</blink>.
</p>
<pre>Oh look, there's a &lt;pre&gt;

</pre>

Expected behaviour, at least what makes sense to me, would be for the parser to out the return value of the function verbatim, not inserting <pre> or <p> tags. I'm pretty sure that was what the behaviour used to be.


Version: 1.18.x
Severity: normal

Details

Reference
bz27906

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:36 PM
bzimport set Reference to bz27906.
bzimport added a subscriber: Unknown Object (MLST).

Apparently I don't know how to search for duplicates. Although I thought this used to work...

  • This bug has been marked as a duplicate of bug 1319 ***