
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@arcmantle/mirage-mde
Advanced tools
A modern, feature-rich Markdown editor built on top of CodeMirror 6 and Lit Element. Mirage-MDE provides a complete markdown editing experience with live preview, syntax highlighting, and extensive customization options.
A modern, feature-rich Markdown editor built on top of CodeMirror 6 and Lit Element. Mirage-MDE provides a complete markdown editing experience with live preview, syntax highlighting, and extensive customization options.
npm install @arcmantle/mirage-mde
pnpm add @arcmantle/mirage-mde
yarn add @arcmantle/mirage-mde
<mirage-mde value="# Hello World"></mirage-mde>
import '@arcmantle/mirage-mde';
const editor = document.querySelector('mirage-mde');
editor.value = '# Hello World\n\nThis is **bold** text.';
const editor = document.querySelector('mirage-mde');
editor.options = {
lineNumbers: true,
lineWrapping: true,
autosave: {
enabled: true,
uniqueId: 'my-editor',
delay: 1000
},
uploadImage: true,
toolbar: ['bold', 'italic', 'heading', '|', 'quote', 'code', 'link']
};
lineNumbers
(boolean): Show line numbers in editorlineWrapping
(boolean): Enable line wrappingtabSize
(number): Tab size in spaces (default: 3)placeholder
(string): Placeholder text for empty editorautofocus
(boolean): Focus editor on loaddirection
('ltr' | 'rtl'): Text directionsingleLineBreaks
(boolean): Convert single line breaks to <br>
codeSyntaxHighlighting
(boolean): Enable syntax highlighting in code blockssanitizerFunction
(function): Custom HTML sanitizerpreviewRender
(function): Custom preview renderertoolbar: [
'bold', 'italic', 'strikethrough', '|',
'heading', 'heading-smaller', 'heading-bigger', '|',
'code', 'quote', 'unordered-list', 'ordered-list', '|',
'link', 'image', 'table', 'horizontal-rule', '|',
'preview', 'side-by-side', 'fullscreen', '|',
'guide'
]
statusbar: [
'autosave', 'lines', 'words', 'cursor'
]
uploadImage: true,
imageMaxSize: 2097152, // 2MB
imageAccept: 'image/png, image/jpeg, image/gif, image/avif',
imageUploadFunction: (file, onSuccess, onError) => {
// Custom upload logic
uploadToServer(file)
.then(url => onSuccess(url))
.catch(error => onError(error.message));
}
autosave: {
enabled: true,
uniqueId: 'my-editor-content',
delay: 1000,
submit_delay: 5000,
text: 'Autosaved: ',
timeFormat: {
locale: 'en-US',
format: {
hour: '2-digit',
minute: '2-digit'
}
}
}
value: string
- The markdown contentoptions: Options
- Editor configurationeditor.value()
- Get current contenteditor.value(content)
- Set contenteditor.action(actionName)
- Execute toolbar actionchange
- Fired when content changesAction | Shortcut |
---|---|
Bold | Ctrl+B |
Italic | Ctrl+I |
Link | Ctrl+K |
Image | Ctrl+Alt+I |
Code Block | Ctrl+Alt+C |
Quote | Ctrl+' |
Unordered List | Ctrl+L |
Ordered List | Ctrl+Alt+L |
Heading | Ctrl+H |
Horizontal Rule | Ctrl+R |
Preview | Ctrl+P |
Side by Side | F9 |
Fullscreen | F11 |
Table | Ctrl+Alt+T |
Toggle Checkbox | Ctrl+D |
Undo | Ctrl+Z |
Redo | Ctrl+Y |
Mirage-MDE supports extensive theming through CSS custom properties:
mirage-mde {
--mmde-border: 2px solid #333;
--mmde-color: #fff;
--mmde-background-color: #1a1a1a;
--mmde-toolbar-bg: #2d2d2d;
--mmde-editor-bg: #1e1e1e;
--mmde-editor-family: 'Fira Code', monospace;
--mmde-preview-family: 'Georgia', serif;
}
const customAction = {
name: 'my-action',
type: 'button',
title: 'My Custom Action',
iconUrl: 'path/to/icon.svg',
action: (view, scope) => {
// Custom action logic
const selection = view.state.selection.main;
const text = view.state.doc.sliceString(selection.from, selection.to);
// Transform text and update editor
}
};
editor.options = {
toolbar: ['bold', 'italic', 'my-action'],
toolbarActions: [customAction]
};
const customStatus = {
name: 'my-status',
template: (item) => `<div>Custom: ${item.value}</div>`,
onUpdate: (item, update) => {
item.value = 'some value';
}
};
editor.options = {
statusbar: ['lines', 'words', 'my-status'],
statusbarStatuses: [customStatus]
};
editor.options = {
renderingConfig: {
preprocessor: [
{
regexp: /\{\{([^}]+)\}\}/g,
replacer: (match, content) => {
// Transform template syntax
return `<span class="template">${content}</span>`;
}
}
]
}
};
Apache-2.0
This is part of the Arcmantle Weave component library. Please refer to the main repository for contribution guidelines.
FAQs
A modern, feature-rich Markdown editor built on top of CodeMirror 6 and Lit Element. Mirage-MDE provides a complete markdown editing experience with live preview, syntax highlighting, and extensive customization options.
We found that @arcmantle/mirage-mde demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.