Page MenuHomePhabricator

:<math> tag works incorrectly with "leave as tex"
Closed, ResolvedPublic

Description

Author: devin

Description:
When using <math> tags it is common to precede with a colon to indent. E.g:

:<math>x^2
+ y
</math>

This code breaks with the "leave as tex" option under preferences. The y ends up on a different line, and a <pre> section is added to the document with just a dollar sign in it.

If we view source we can see what's happening. The colon indents using <dl> tags. In "leave as tex" mode we get something like:

<dl><dd>$ x^2
</dd></dl>
<p>+ y
</p>
<pre>$

when what we want is:

<dl><dd>$ x^2 + y$
</dd></dl>

The problem appears to be the order in which tags are added.

I have the same trouble using the jsMath plugin -- works fine except when there's a colon before multiline math.


Version: 1.15.x
Severity: normal

Details

Reference
bz22818

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:05 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz22818.
bzimport added a subscriber: Unknown Object (MLST).

Should newlines be removed from the end of <math> or also from the middle? Or perhaps removed from the sides but those in the middle replaced with spaces.

mimamer wrote:

IMO *any* whitespace (including newlines) should be replaced by a single space. That is how TeX works anyway. For additional spaces there are special markups. For newlines it is more logical to do this outside of <math> clauses.

Fixed in r65039.

*** This bug has been marked as a duplicate of bug 23190 ***