How to add preview functionality for markdown/LaTex code in ReactJS application

Viewed 110

Recently I have create a fullstack bloging website here. For writing blog I used react-quill because its extensible architecture and an expressive API, I can completely customize it to fulfill my needs. But Now I feeling that I need something which can handle markdown and LaTeX also. I was wondering is there any library which can handle both or at least LaTeX one with an expressive API?

And one more question, How stackoverflow give preview system(live preview of our markdown/LaTex code) when we ask a question? Because it's a really an important functionality when you writing a blog. It will be great help if anyone let me informed anything related with this.


I found react-latex and react-markdown to handle markdown and LaTex seperately. But still hanging on how to setup preview functionality. Any idea will be appreciated.

1 Answers

Input the text to react-markdown and preview the output in a div element.

You can check the source code of some open-source online markdown editor. They support latex also.

Reference:

Related