@vmz/plugin-mathjax 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Mathjax.vmz +12 -13
- package/package.json +2 -2
package/components/Mathjax.vmz
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<div v-html="html != null ? html : fallback(tex)" class="mathjax-host" />
|
|
3
3
|
</template>
|
|
4
|
-
|
|
5
4
|
<script client>
|
|
6
|
-
import { renderMathjax, renderMathjaxFallback } from
|
|
5
|
+
import { renderMathjax, renderMathjaxFallback } from "@vmz/plugin-mathjax/runtime";
|
|
7
6
|
|
|
8
7
|
function fallback(tex) {
|
|
9
|
-
|
|
8
|
+
return renderMathjaxFallback(tex);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export default class Mathjax {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
public tex: string = "";
|
|
13
|
+
public display: boolean = false;
|
|
14
|
+
html: string | null = null;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
async onMount() {
|
|
17
|
+
try {
|
|
18
|
+
this.html = await renderMathjax(this.tex, this.display);
|
|
19
|
+
} catch {
|
|
20
|
+
this.html = renderMathjaxFallback(this.tex);
|
|
21
|
+
}
|
|
22
22
|
}
|
|
23
|
-
}
|
|
24
23
|
}
|
|
25
24
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/plugin-mathjax",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VMZ MathJax adapter - <Mathjax> + math engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@vmz/plugin": "0.2.
|
|
20
|
+
"@vmz/plugin": "0.2.5"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@mathjax/src": ">=4"
|