The lightMarkDown Editor
Markdown stays visible. Headings look like headings;
**bold** looks bold. The writing area uses a local monospace font.
All four libraries · HTML editor · Markdown editor skins · Simple iframe example · Syntax highlighter
Starting the editor…
This is the text returned by the editor, not HTML. Nothing is uploaded or stored automatically.
Select text and try the toolbar or Ctrl/Cmd+B/I/K. Your Markdown stays editable, with native selection and undo. Click a source task marker to check or uncheck it. Preview stays read-only, including the HTML half of Side-by-side. Both render locally with MeltDown; images render in Preview while their Markdown stays visible in source. Use a maintained HTML sanitizer when publishing untrusted content.
Load shared editor CSS, then MaiDEn CSS. MeltDown enables Preview and Side-by-side. The optional poliSH hook colors fenced and inline code as you type. Unlabeled code uses language guessing; explicit labels take priority.
<link rel="stylesheet" href="lightmetal.css">
<link rel="stylesheet" href="maiden.css">
<link rel="stylesheet" href="polish.css">
<div id="editor" class="lightmetal"></div>
<script src="MeltDown.js"></script>
<script src="polish.js"></script>
<script src="maiden.js"></script>
<script>
const highlighter = polish.createHighlighter({ languages: polish.allLanguages });
const editor = maiden.init({
element: document.getElementById('editor'),
sourceHighlight: highlighter.highlightTokens,
preview: { render: text => meltDown.parse(text, { highlight: highlighter.highlight }) },
onChange: markdown => console.log(markdown)
});
editor.setMarkdown('# Hello, MaiDEn!');
editor.element.querySelector('.lightmarkdown-preview').classList.add('polish', 'theme-light');
</script>
Read source with editor.getMarkdown(). Use editor.insertText(text) for native insertion and editor.destroy() on teardown. Omit preview for source-only editing, or supply your own renderer.