Search code examples
reactjsmernrich-text-editor

Using rich text editor in a react application


I am planning to develop a blogging platform using the MERN stack, and I need a rich text editor for editing the blog posts. The editor should be programmer-friendly. I was thinking about an editor like that StackOverflow is currently using, where we can add code snippets and run them at the same time.

So are there any react libraries that provide that kind of functionality with a rich text editor?

Or do I have to get a library like react quill and modify it according to my requirements? And I want to know whether it is possible to add such functionality.

suggestions are greatly appreciated.:)


Solution

  • there's few good editors you can use for that purpose. below are some of my recommendations

    • if you want a github like editor ( the github markdown editor ) https://uiwjs.github.io/react-md-editor/ this will be a really good choice. it comes with code highlighting and all those cool features by default with GitHub inspired styles.

    • in case you are more interested in to stack-overflow type editor i can recommend you the Stack Overflow's Combination Rich Text / Markdown Editor. you can find it from https://editor.stackoverflow.design/

    • if you are more interested on simplicity and want something more simple without lot of features i can recommend you https://www.npmjs.com/package/react-markdown-editor-lite this editor. for the most part its all right

    also there's many more other choices like Facebook's draft.js. but i think above text editors will be better choice for your use case.