Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KaTeX in markdown-it #50

Open
ptah-alexs opened this issue Jan 7, 2019 · 4 comments
Open

KaTeX in markdown-it #50

ptah-alexs opened this issue Jan 7, 2019 · 4 comments

Comments

@ptah-alexs
Copy link

Please add KaTeX into markdown-in bundle in QOwnNotes.

https://www.npmjs.com/package/@iktakahiro/markdown-it-katex

@pbek
Copy link
Member

pbek commented Jan 7, 2019

I'm open for pull requests. See #48.
(4859db3 will help you too)

@r00tr4v3n
Copy link
Contributor

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

@pbek
Copy link
Member

pbek commented May 31, 2020

Has "the internet" something to say about that?

@r00tr4v3n
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants