Page MenuHomePhabricator

Inclusion of template containing div tag in page containing math tags causes parser to drop paragraph tags
Closed, DeclinedPublic

Description

This issue was replicated on the trunk version of MediaWiki with the trunk version of Math.

When including a template that contains a <div> tag on an article that contains a <math> tag, the <p> paragraph tags are dropped around some surrounding text. Since this is hard to explain, I will show my test pages:

http://104.131.177.223/mediawiki/index.php/Math_Test
http://104.131.177.223/mediawiki/index.php/Math_Test_2

Why this is a problem:

At wikiHow, my current employer, a library called phpquery is used to re-arrange and wrap elements in the article to match up with our skin. When the <p> tag is lost, the text ends up outside our introduction section div, forcing us to use a workaround to get the style back (like manually surrounding the text only with <p> (the template can not be in the paragraph tag). I do not know enough about MediaWiki and Math's internal parser to think of a patch right away.

wikiHow production example: https://www.wikihow.com/index.php?title=Calculate-Bond-Value&diff=prev&oldid=19709660