mediawiki-extensions-Math/mathParserTests.txt
Brion Vibber dd490761b5 * (bug 27324) \euro support for <math>
Reapplied r87284 with a tweak to allow \euro through to conservative HTML output.
Parser test case added to confirm that \euro is HTMLable and the other euro variants are renderable to images.

This commit also includes tweaks to HTMLification of \phi, \varphi, and \varepsilon (conservative HTML) and changes the non-conservative HTMLification of number sets from plain letters to the dedicated Unicode chars for their symbols. These changes are not included in tests, but don't alter what input is supported.
2011-09-13 21:48:07 +00:00

69 lines
2.7 KiB
Plaintext

!! test
pre-save transform: comment containing math
!! options
pst
!! input
<!-- <math>data</math> -->
!!result
<!-- <math>data</math> -->
!!end
#!! test
#BUG 1887: A <math> 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.
#!! input
#[[Image:foobar.jpg|thumb|<math>2+2</math>]]
#!! result
#<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>&lt;math&gt;2+2&lt;/math&gt;</div></div></div>
#
#!! end
!! test
BUG 1887, part 2: A <math> with a thumbnail- math enabled
!! options
math
!! input
[[Image:foobar.jpg|thumb|<math>2+2</math>]]
!! result
<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div><span class="texhtml" dir="ltr">2 + 2</span></div></div></div>
!! end
#!! test
#Math section safety when disabled
#!! input
#<math><script>alert(document.cookies);</script></math>
#!! result
#<p>&lt;math&gt;&lt;script&gt;alert(document.cookies);&lt;/script&gt;&lt;/math&gt;
#</p>
#!! end
!! test
BUG 26380: Add \widetilde support to match \widehat
!! input
<math>\widehat{x}</math>
<math>\widetilde{x}</math>
!! result
<p><img class="tex" alt="\widehat{x}" src="/images/math/9/9/8/998309e831dfb051f233c92b4b8a825b.png" />
<img class="tex" alt="\widetilde{x}" src="/images/math/e/9/e/e9e91996778a6d6f5cdf4cc951955206.png" />
</p>
!! end
!! test
BUG 27324: Euro symbol for math
!! input
<math>\euro 200</math>
<math>\geneuro</math>
<math>\geneuronarrow</math>
<math>\geneurowide</math>
<math>\officialeuro</math>
!! result
<p><span class="texhtml" dir="ltr">&#8364;200</span>
<img class="tex" alt="\geneuro" src="/images/math/9/8/b/98b63c235ee187a38267e0e170b10e9d.png" />
<img class="tex" alt="\geneuronarrow" src="/images/math/a/a/4/aa4a1ed370f4ee705c6930384bf89502.png" />
<img class="tex" alt="\geneurowide" src="/images/math/4/4/0/4404468e6187fb04e4f7e1f15e550825.png" />
<img class="tex" alt="\officialeuro" src="/images/math/d/7/0/d708de0eed23dbd6f02b99ea9073547b.png" />
</p>
!! end