Live Markdown Text Editor


Split-screen Markdown/ HTML with inline CSS styles Editor with a Live Preview, code highlighting & dark mode written in React & Next.js

Tech Stack

React

React Router

Markdown

Bootstrap

Welcome to
online split-screen Markdown/ HTML Editor with a Live Preview!


πŸ“ Write (using the editor on the left side πŸ‘ˆ)

  • common Markdown syntax extended with Github Flavored Markdown (GFM) (see the guide)
  • vanilla HTML tags with inline CSS styles & embed HTML elements, like video, audio, websites etc. (see the guide)
  • highlighted code blocks

πŸ”Ž & see how it is rendered as an HTML! (in the renderer on the right side πŸ‘‰)


Actually... 😏 you can edit this rendered default text right now by editing Markdown in the editor on the left! πŸ‘ˆπŸ˜Ž

Or... you can start from scratch in the editor, write some Markdown & it will be πŸ’Ύ saved automatically in local storage for future use!


πŸ’ͺBattle-tested Markdown Editor & Renderer


This Markdown Editor & Rendered (these are 2 separate components) is used in a few of my real-world open source projects:


πŸš€Updates after 3 years😏


The project was established in 2021, but it was upgraded, extended & rewritten basically from scratch in January 2024.

I've added new editor/renderer features, upgraded tech stack (upgraded React and finally migrated to Next.js) & added new guides. Let's dive in!


New Markdown Editor/ Renderer features


Editor/ Renderer Features20222024
Markdownβœ…βœ…
GitHub Flavored Markdown (GFM)βœ…βœ…
code highlighting (auto light & dark mode)βŒβœ…
HTML tagsβŒβœ…
inline CSS stylesβŒβœ…
embed elementsβŒβœ…
react-markdown/ custom renderer switchingβŒβœ…

New App features


App Features20222024
RoutingβŒβœ…
Dark/ Light ModeβŒβœ…
GuidesβŒβœ…
Show/ hide editor/ rendererβŒβœ…

New additional custom renderer (along with previous react-markdown based renderer)


Also I've created & added a new custom react-markdown-free Markdown Renderer along with the existing renderer built on top of react-markdown renderer, so now you can switch between them using a checkbox in the navbar. Custom renderer is the default option (becuase it's bugs-free 😏).

Those 2 coexisting renderers give almost same input, but there are a few differences (pros & cons):

react-markdown based editorcustom renderer
react-markdownβœ…βŒ
remark pluginsβœ…βŒ
rehype pluginsβœ…βŒ
footnotesβœ…βŒ
partial HTML/ CSS inline styles bug-freeβŒβœ…
markedβŒβœ…
dompurifyβŒβœ…
highlight.jsβŒβœ…

Technologies used in the project


Technologies20222024 (1st upgrade)2024 (2nd upgrade)
next❌❌14.0.4
react17.0.218.2.018.2.0
javascriptβœ…βœ…βœ…
typescriptβŒβŒβœ…
react-markdown7.0.19.0.19.0.1
react-router-dom❌6.21.1❌
bootstrap5.1.35.3.25.3.2
bootstrap-icons❌1.11.31.11.3
remark-gfm3.0.04.0.04.0.0
rehype-raw❌7.0.07.0.0
rehype-highlight❌7.0.07.0.0
dompurify❌3.0.83.0.8
isomorphic-dompurify❌❌2.2.0
marked❌11.1.111.1.1
highlight.js❌11.9.011.9.0
gh-pages3.2.36.1.1❌
GitHub Pages/ GitHub Actions/ CI/CDβŒβŒβœ…
πŸ’Ύ localStorage (to store inputed markdown)βœ…βœ…βœ…

🐞 WARNING!
Partial HTML/ inline CSS bug
in react-markdown based renderer
(❗use custom renderer instead (default)❗)


If you're using react-markdown renderer option, you can get some errors caused by partial HTML or incomplete inline CSS styles in your markdown while you're editing content & the app may crash...

I will fix it eventually, but don't worry - your content is always synced with local storage, so refresh the page & fix your partial HTML in non react-markdown renderer option (by default the editor is using my custom md renderer, which is not causing such errors) & you can continue working with react-markdown based renderer if you want to.