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@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l