Open ptah-alexs opened 5 years ago
I'm open for pull requests. See #48. (https://github.com/qownnotes/scripts/commit/4859db3504371579ae82bba610bc25b6ecbc21e9 will help you too)
This looks interesting, it should be faster than generating (two) images for formulas (as preview and export). But how do I access the library correctly in QML? I tried:
import "katex.js" as Katex
...
property variant katex;
....
katex = new this.Katex();
...
html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
throwOnError: false
});
markdown-it.qml:73: TypeError: Type error
markdown-it/katex.js:271: TypeError: Type error
Has "the internet" something to say about that?
Nothing of use to me. As a JS/QML novice, I'd expected the library to be called statically with katex.renderToString()
or to be instantiated as a module like var katex = new Katex()
. I don't get if this is a petty JS mistake or a missing step for QML.
Please add KaTeX into markdown-in bundle in QOwnNotes.
https://www.npmjs.com/package/@iktakahiro/markdown-it-katex