Hello again,
It may surprise you to find out that I have also investigated that
problem in depth. :)
There are two things playing against you, even if you use the
insertStripItem() method. One is the whitespace list processing
(which you've discovered), and the second is Tidy.
If you must have pure, unadulterated HTML from a parser function,
you'll effectively want to "hide" data from the parser, then
re-introduce it later.
You can do this by:
1) Have your parser function output an encoded HTML comment (protected
as usual by the insertStripItem() trick)
2) Create a function hooking 'ParserAfterTidy' which looks for any
encoded HTML comments and replaces them with the desired content.
Basically you want to combine the techniques you already know with the
one explained in this article:
http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_Parser_Exten…
Good luck!
-- Jim
On Wed, Jun 25, 2008 at 4:21 PM, Sergey Chernyshev
<wikitech-l(a)antispam.sergeychernyshev.com> wrote:
Actually, it looks like you provided a solution only
to the first problem i
mentioned - preceding <p> tag and yes, it works, thank you!
But second problem still exists, but the patch I mentioned (
https://bugzilla.wikimedia.org/show_bug.cgi?id=8997#a0) is resolving second
issue where output is getting parsed as wiki-text which causes HTML to still
be considered wiki-text and inserts <p>s when two consequent newlines were
used. I wonder if there is any way to avoid that without patching MW code.
Sergey
On Tue, Jun 24, 2008 at 4:58 PM, Sergey Chernyshev <
wikitech-l(a)antispam.sergeychernyshev.com> wrote:
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 );
That's what I suggested! Based on your original example, of course. ;-)
Actually I didn't provide the example because I was worried about it in
general ;)
BTW, I realized that this problem came up before and I even posted a patch
based on somebody else's explanation of the solution to Bugzilla back in
August:
https://bugzilla.wikimedia.org/show_bug.cgi?id=8997#a0
I'll also think about using insertStripItem - never used it before so I
have to read up on it.
Sergey
Joshua
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
Sergey Chernyshev
http://www.sergeychernyshev.com/
--
Sergey Chernyshev
http://www.sergeychernyshev.com/
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l