File: bug-dollars.html

package info (click to toggle)
node-markdown-it-texmath 1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 236 kB
  • sloc: javascript: 591; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 976 bytes parent folder | download
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
<!doctype html>
<html>
<head>
  <meta charset='utf-8'>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css">
  <link rel="stylesheet" href="../css/texmath.css">
  <script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script>
  <script src="../texmath.js"></script>
</head>
<body>
  <div id="out"></div>
  <script>
    const str = `
  # Simple Dollar tests
  ## Inline

  here "$a+\\$ = b$" we "$\\$$" go "$\\text{\\$some...\\$}$"

  ## Inline block (single line only)
  
  $$a+\\$ = \\text{\\$more...\\$} \\$$$  or ...

  ## Block (multiline)

  $$
  a+\\$ = \\text{\\$text...\\$} \\$
  $$

inline $$x^2$$ formula
`
    document.addEventListener("DOMContentLoaded", () => {
        const md = markdownit().use(texmath, { engine: katex, delimiters: 'dollars' });
        out.innerHTML = md.render(str);
    })
  </script>
</body>
</html>