Markdown editor with preview.
https://luna.liriliri.io/?path=/story/markdown-editor
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-carousel/luna-carousel.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-syntax-highlighter/luna-syntax-highlighter.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-markdown-viewer/luna-markdown-viewer.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-markdown-editor/luna-markdown-editor.css" />
<script src="//cdn.jsdelivr.net/npm/luna-carousel/luna-carousel.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-syntax-highlighter/luna-syntax-highlighter.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-markdown-viewer/luna-markdown-viewer.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-markdown-editor/luna-markdown-editor.js"></script>
You can also get it on npm.
npm install luna-markdown-editor luna-markdown-viewer luna-syntax-highlighter luna-gallery luna-carousel --save
import 'luna-carousel/luna-carousel.css'
import 'luna-gallery/luna-gallery.css'
import 'luna-syntax-highlighter/luna-syntax-highlighter.css'
import 'luna-markdown-viewer/luna-markdown-viewer.css'
import 'luna-markdown-editor/luna-markdown-editor.css'
import LunaMarkdownEditor from 'luna-markdown-editor'
const markdownEditor = new LunaMarkdownEditor(container)
- markdown(string): Initial markdown text.
Get or set markdown text.