Skip to content

Commit 078956c

Browse files
committed
Katex code from ink
1 parent d49dc1b commit 078956c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/ui/katexify.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use babel'
2+
3+
// this file is lazy loaded by dynamic import simulation
4+
5+
import { renderToString } from 'katex'
6+
7+
export function texify (input, block) {
8+
try {
9+
return renderToString(input, {throwOnError: false, displayMode: block})
10+
} catch (e) {
11+
return input
12+
}
13+
}

0 commit comments

Comments
 (0)