As documented in this page from 2007, it used to be the case that whitespace was added before parser function-generated HTML.
To work around this, instead of the straightforward:
function renderRawHTML( &$parser, $input='' ) { return array( $input, noparse => true, isHTML => true ); }
...extension authors instead wrote:
function renderRawHTML( &$parser, $input='' ) { return $parser->insertStripItem( $input, $parser->mStripState ); }
We'd like to reduce unnecessary usage of insertStripItem and the exposure of parser internal state from parser function implementations.
The bug this was working around was fixed by @SPQRobin in commit 84b8ca9801c0e1ad3bcd4c7d6d5d58c26a69d1b7 in May 2012 and first shipped in 1.20wmf9.
Some actions items (should eventually be made into sub-tasks):
- Add a code to the core parser to warn or log if insertStripItem is called during a parser function invocation, which will help determine the extent of the issue.
- Fix Extension:PageForms, where this pattern was discovered (already requires MW 1.21+)
- Determine other extensions which might be using this pattern.