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

How to use it in Nuxt3? #261

Open
mylooksback opened this issue Jul 10, 2023 · 2 comments
Open

How to use it in Nuxt3? #261

mylooksback opened this issue Jul 10, 2023 · 2 comments

Comments

@mylooksback
Copy link

Hi, many thanks for your work!

Could you please help me ?I want to use it in Nuxt3, but the server rendering cannot operate on the DOM. What should I do.

I want to use it in Nuxt3, but the server rendering cannot operate on the DOM. What should I do.

@OlgaRedozubova
Copy link
Contributor

@mylooksback mathpix-markdown-it uses domino to work with the DOM tree where it is not supported, and liteAdaptor is used to render the math.
This should work for server rendering as well.

This is a working example for node.js
https://github.com/Mathpix/mathpix-markdown-it/blob/master/examples/app.js
htmlMM = MathpixMarkdownModel.markdownToHTML(text);
Here you can pass the resulting htmlMM to the client side.
Or use Puppeteer to paste the htmlMM and get the finished page on the server.

More use cases on the server side:
https://github.com/Mathpix/mathpix-markdown-it/tree/master#nodejs

@jiang1654
Copy link

I also have the same question. Can you tell me the specific import method in nuxt3

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

No branches or pull requests

3 participants