Skip to content

Commit 3fadbd3

Browse files
committed
dynamic import simulaiton
1 parent 3b546d4 commit 3fadbd3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ui/views.coffee

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ module.exports = views =
9595

9696
latex: ({attrs, text}) ->
9797
block = attrs?.block || false
98-
latex = @ink.KaTeX.texify(text, block)
98+
99+
# dynamic import simulation
100+
latex = null
101+
texify = Promise.resolve()
102+
.then( () -> return require("./katexify.js"))
103+
.then( (texify) -> latex = texify(text, block));
104+
99105
@render {type: 'html', block, content: latex}
100106

101107
views:

0 commit comments

Comments
 (0)