Make error HTML valid XHTML

Allows easy parsing using XML tools

Change-Id: I27b5a8b719d703636c2c09d513cd04766fc66ce1
This commit is contained in:
Tpt 2019-04-23 17:18:01 +02:00
parent 64d0b3e3ea
commit d51e0ae06a
2 changed files with 5 additions and 5 deletions

View File

@ -214,7 +214,7 @@ abstract class MathRenderer {
$mf = wfMessage( 'math_failure' )->inContentLanguage()->escaped();
$errmsg = wfMessage( $msg, $parameters )->inContentLanguage()->escaped();
$source = htmlspecialchars( str_replace( "\n", ' ', $this->tex ) );
return "<strong class='error texerror'>$mf ($errmsg): $source</strong>\n";
return "<strong class=\"error texerror\">$mf ($errmsg): $source</strong>\n";
}
/**

View File

@ -2123,7 +2123,7 @@
{
"input": " with a thumbnail- we don't render math in the parsertests by default, so math is not stripped and turns up as escaped &lt;math&gt; tags. [[Image:foobar.jpg|thumb|<math>2+2",
"params": [],
"output": "<strong class='error texerror'>Failed to parse (syntax error): {\\displaystyle with a thumbnail- we don't render math in the parsertests by default, so math is not stripped and turns up as escaped &amp;lt;math&amp;gt; tags. [[Image:foobar.jpg|thumb|&lt;math&gt;2+2}<\/strong>\n"
"output": "<strong class=\"error texerror\">Failed to parse (syntax error): {\\displaystyle with a thumbnail- we don't render math in the parsertests by default, so math is not stripped and turns up as escaped &amp;lt;math&amp;gt; tags. [[Image:foobar.jpg|thumb|&lt;math&gt;2+2}<\/strong>\n"
},
{
"input": " with a thumbnail- math enabled [[Image:foobar.jpg|thumb|<math>2+2",
@ -2293,12 +2293,12 @@
{
"input": "",
"params": [],
"output": "<strong class='error texerror'>Failed to parse (Conversion error. Server (&quot;https:\/\/wikimedia.org\/api\/rest_&quot;) reported: &quot;Cannot get mml. Expected width &gt; 0.&quot;): {\\displaystyle }<\/strong>\n"
"output": "<strong class=\"error texerror\">Failed to parse (Conversion error. Server (&quot;https:\/\/wikimedia.org\/api\/rest_&quot;) reported: &quot;Cannot get mml. Expected width &gt; 0.&quot;): {\\displaystyle }<\/strong>\n"
},
{
"input": " ",
"params": [],
"output": "<strong class='error texerror'>Failed to parse (Conversion error. Server (&quot;https:\/\/wikimedia.org\/api\/rest_&quot;) reported: &quot;Cannot get mml. Expected width &gt; 0.&quot;): {\\displaystyle }<\/strong>\n"
"output": "<strong class=\"error texerror\">Failed to parse (Conversion error. Server (&quot;https:\/\/wikimedia.org\/api\/rest_&quot;) reported: &quot;Cannot get mml. Expected width &gt; 0.&quot;): {\\displaystyle }<\/strong>\n"
},
{
"input": "\\left(\\begin{smallmatrix}a & b\\\\ c & d\\end{smallmatrix}\\right)",
@ -2310,4 +2310,4 @@
"params": [],
"output": "<img src=\"085412b37ef2ac62058f72715866515b3ee71f39\" class=\"mwe-math-fallback-image-inline\" aria-hidden=\"true\" style=\"vertical-align: -1.171ex; width:1.417ex; height:3.343ex;\" alt=\"{\\displaystyle \\AA}\"\/>"
}
]
]