https://github.com/vadimgierko/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
https://github.com/vadimgierko/markdown-text-editor
code-highlight css custom-editor dark-mode dompurify embed github-pages highlight-js html live-preview localstorage markdown markdown-editor markdown-renderer marked marked-js next-js react react-markdown react-router
Last synced: 2 days ago
JSON representation
Split-screen Markdown/ HTML with inline CSS styles Editor with a Live Preview, code highlighting & dark mode written in React & Next.js
- Host: GitHub
- URL: https://github.com/vadimgierko/markdown-text-editor
- Owner: vadimgierko
- Created: 2021-10-14T14:15:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2026-06-17T11:15:49.000Z (19 days ago)
- Last Synced: 2026-06-17T12:21:49.912Z (19 days ago)
- Topics: code-highlight, css, custom-editor, dark-mode, dompurify, embed, github-pages, highlight-js, html, live-preview, localstorage, markdown, markdown-editor, markdown-renderer, marked, marked-js, next-js, react, react-markdown, react-router
- Language: TypeScript
- Homepage: https://vadimgierko.github.io/markdown-text-editor/
- Size: 552 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](/markdown-guide))
- vanilla **HTML tags with inline CSS styles & embed HTML elements**, like video, audio, websites etc. ([see the guide](/html-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](/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**:
- linky_notes π [app](https://vadimgierko.github.io/linky-notes/) | [repo](https://github.com/vadimgierko/linky-notes)
- Issue Tracker π [app](https://github.com/vadimgierko/issue-tracker) | [repo](https://issue-tracker-react-ts.vercel.app/)
- my personal website π [website](https://www.vadimgierko.com/) | [repo](https://github.com/vadimgierko/personal-website-next-js)
- Blogging Platform (old & new versions) π [platform](https://vadimgierko.github.io/blogging-platform/) | [repo](https://github.com/vadimgierko/blogging-platform-next-js)
---
## π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 Features | 2022 | 2024 |
| --- | --- | --- |
| 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 Features | 2022 | 2024 |
| --- | --- | --- |
| 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 editor | custom renderer |
| --- | :---: | :---: |
| [react-markdown](https://remarkjs.github.io/react-markdown/) | β
| β |
| *remark* plugins | β
| β |
| *rehype* plugins | β
| β |
| footnotes | β
| β |
| partial HTML/ CSS inline styles bug-free | β | β
|
| [marked](https://marked.js.org/) | β | β
|
| [dompurify](https://github.com/cure53/DOMPurify) | β | β
|
| [highlight.js](https://highlightjs.org/) | β | β
|
---
## Technologies used in the project
---
| Technologies | 2022 | 2024 (1st upgrade) | 2024 (2nd upgrade) |
| --- | :-: | :-: | :-: |
| next | β | β | 14.0.4 |
| react | 17.0.2 | 18.2.0 | 18.2.0 |
| javascript | β
| β
| β
|
| typescript | β | β | β
|
| react-markdown | 7.0.1 | 9.0.1 | 9.0.1 |
| react-router-dom | β | 6.21.1 | β |
| bootstrap | 5.1.3 | 5.3.2 | 5.3.2 |
| bootstrap-icons | β | 1.11.3 | 1.11.3 |
| remark-gfm | 3.0.0 | 4.0.0 | 4.0.0 |
| rehype-raw | β | 7.0.0 | 7.0.0 |
| rehype-highlight | β | 7.0.0 | 7.0.0 |
| dompurify | β | 3.0.8 | 3.0.8 |
| isomorphic-dompurify | β | β | 2.2.0 |
| marked | β | 11.1.1 | 11.1.1 |
| highlight.js | β | 11.9.0 | 11.9.0 |
| gh-pages | 3.2.3 | 6.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.