| 1 |
<!doctype html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta charset='utf-8'> |
| 5 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css"> |
| 6 |
<link rel="stylesheet" href="../css/texmath.css"> |
| 7 |
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script> |
| 8 |
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script> |
| 9 |
<script src="../texmath.js"></script> |
| 10 |
</head> |
| 11 |
<body> |
| 12 |
<div id="out"></div> |
| 13 |
<script> |
| 14 |
const str = ` |
| 15 |
# Simple Dollar tests |
| 16 |
## Inline |
| 17 |
|
| 18 |
here "$a+\\$ = b$" we "$\\$$" go "$\\text{\\$some...\\$}$" |
| 19 |
|
| 20 |
## Inline block (single line only) |
| 21 |
|
| 22 |
$$a+\\$ = \\text{\\$more...\\$} \\$$$ or ... |
| 23 |
|
| 24 |
## Block (multiline) |
| 25 |
|
| 26 |
$$ |
| 27 |
a+\\$ = \\text{\\$text...\\$} \\$ |
| 28 |
$$ |
| 29 |
|
| 30 |
inline $$x^2$$ formula |
| 31 |
` |
| 32 |
document.addEventListener("DOMContentLoaded", () => { |
| 33 |
const md = markdownit().use(texmath, { engine: katex, delimiters: 'dollars' }); |
| 34 |
out.innerHTML = md.render(str); |
| 35 |
}) |
| 36 |
</script> |
| 37 |
</body> |
| 38 |
</html> |