forked from christianp/asciimath2tex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
65 lines (62 loc) · 2.27 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.js"></script>
<script src="test.js" type="module"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.css"></link>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_CHTML"></script>
<style type="text/css">
#tests {
font-family: monospace;
border-collapse: collapse;
}
#tests th {
text-align: left;
}
#tests th, #tests td {
border: 1px solid;
}
#tests tr.mismatch td {
background: #eee;
}
#tests tr.failed td {
background: hsl(0,50%,90%);
}
#asciimath {
width: 100%;
}
section ~ section {
margin-top: 3em;
padding-top: 2em;
border-top: 1px solid #ccc;
}
</style>
</head>
<body>
<section>
<label>AsciiMath: <input id="asciimath"></label>
<p>TeX:<pre id="tex"></pre></p>
<p>KaTeX rendering:</p>
<p id="display"></p>
</section>
<section>
<p>These tests come from <a href="https://github.com/asciimath/asciimathml/blob/master/test/unittests.js">https://github.com/asciimath/asciimathml/blob/master/test/unittests.js</a>.</p>
<p>They confirm that the AsciiMath is parsed correctly and rendered using KaTeX, and then should be compared visually with MathJax's rendering of the expected MathML.</p>
<button type="button" id="run-tests">Run tests</button>
<table id="tests">
<thead>
<tr>
<th>Input</th>
<th>Expected</th>
<th>Output</th>
<th>KaTeX</th>
<th>MathML</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</section>
</body>
</html>