Sergey said:
First issue: Output of all parser functions is preceded with "\n\n" in Parser.php line 2975 (on current stable 1.12 branch) which purposefully forces closing </p><p> combination which contradicts with users expectations that it will actually be inline if they put parser function inline. Here's the code: --SNIP-- This is quite distracting since there is no way to work around this in extensions or page text.
You're correct that it's quite distracting, but fortunately there is a workaround - more on that in a second.
Joshua said:
In Widgets.php, it sounds like maybe you want to replace:
return array($output, 'noparse' => true, 'isHTML' => true, 'noargs' => true);
It would be nice it that would work, but unfortunately, it's not the silver bullet you might expect. MediaWiki inserts the aforementioned newlines regardless of whether the parser function utilizes the alternative array return type.
I have studied this problem in depth[1], and my standing recommendation is to use the parser's insertStripItem() function thusly:
return $parser->insertStripItem( $output, $parser->mStripState );
This will bypass the newline insertion altogether. Good luck!
[1] http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Par...
-- Jim
On Sat, Jun 21, 2008 at 12:40 PM, Joshua C. Lerner jlerner@gmail.com wrote:
On Sat, Jun 21, 2008 at 12:36 PM, Sergey Chernyshev wikitech-l@antispam.sergeychernyshev.com wrote:
I'm getting complaints from users using my Widgets and HeaderTabs extensions' parser functions that their output is mangled with <p> tags.
In Widgets.php, it sounds like maybe you want to replace:
return array($output, 'noparse' => true, 'isHTML' => true, 'noargs' => true);
with
return $parser->insertStripItem($output, $parser->mStripState);
There was a similar issue here:
http://www.mediawiki.org/w/index.php?title=Extension_talk:Icon&diff=prev...
Joshua
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l