ME.js Documentation

Options, toolbar features, public API and architecture — everything in one place.

Configuration Options

Passed to ME.init(opts) / the options prop (Vue & React).

OptionTypeDefaultDescription
mountstring'#app'CSS selector of the mount element (JS version)
titlestring'ME.js Editor'Title shown in the top nav
placeholderstring'Start writing...'Empty-state hint
iconsModestring'remote'Google Material Icons from web, or 'local' stylesheet
importFromContentbooleantrueImport the mount element's inner content as the initial document (JS version)
uploadUrlstringnullPaste-image upload endpoint; falls back to base64 when unset or unreachable
pasteImagestring'auto''auto' | 'base64' | 'upload'
showViewCodebooleantrueToolbar View-Markdown button
showCopybooleantrueToolbar Copy-Markdown button
showAudiobooleantrueToolbar Audio insert button
showVideobooleantrueToolbar Video insert button
showStatusBarbooleantrueBottom character-count bar
maxLengthnumber0Character cap; count turns red when exceeded (0 = unlimited)

Toolbar Features

Select text and click an icon — formatting applies instantly.

Inline

Bold (Ctrl+B) · Italic (Ctrl+I) · Strikethrough · Inline code · Text color

Block

H1 / H2 / H3 · Normal text · Blockquote · Bullet / numbered / task lists · Code block · Table (rows/columns dialog) · Horizontal rule

Insert

Link · Image (title + URL dialog) · Audio · Video · Paste images from clipboard

Tools

Eraser (clears all formatting of selection) · Undo / Redo · View Markdown source · Copy Markdown to clipboard

Public API JS version

All access goes through ME.instance (returned by ME.init()). Vue exposes the same methods via template ref; React via ref.

ME.instance.getMarkdown()          // pure Markdown
ME.instance.getHTML()              // rendered HTML
ME.instance.getRawHTML()           // raw editor DOM HTML
ME.instance.export()               // { markdown, html, mixed }
ME.instance.exportMixed()          // MD + HTML blocks for tables/code
ME.instance.download('doc', 'md')  // 'md' | 'html' | 'mixed'
ME.instance.setMarkdown('# ...')   // import Markdown string
ME.instance.importFromElement('#src')  // import from any element
ME.instance.clear()

// core modules (all three versions export these)
ME.MdParser.parse('# markdown')     // -> HTML
ME.MdSerializer.serialize(domNode)  // -> Markdown

Architecture

Three independent modules — the parsing and serialization layers are identical across all three framework versions.

Markdown source <-> MdParser <-> WYSIWYG DOM <-> MdSerializer <-> Markdown storage
                                        |
                                 Editor (toolbar, API)

┌──────────────┬──────────────────────────────────────────────┐
│ me-editor.js │ vanilla JS — ME.init(), works anywhere       │
│ me-vue.js    │ Vue 3 — <me-editor v-model="content" />      │
│ me-react.js  │ React 18 — <MeEditor value onChange />       │
└──────────────┴──────────────────────────────────────────────┘

Paste-Image Upload

Set uploadUrl and pasted images upload to your backend; the response { "url": "..." } becomes the inserted image source. Without it, images fall back to base64.

# minimal Python receiver (server.py ships in the repo)
# python server.py  ->  POST /upload  on port 1688
# multipart/form-data field "file"  ->  { "url": "/uploads/xxx.png" }