editor-core
Work with the contenteditable editor implementation. Use when modifying text input behavior, cursor handling, or undo/redo functionality.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Work with the contenteditable editor implementation. Use when modifying text input behavior, cursor handling, or undo/redo functionality.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | editor-core |
| description | Work with the contenteditable editor implementation. Use when modifying text input behavior, cursor handling, or undo/redo functionality. |
Work with the contenteditable editor in kheMessage.
The Editor class manages the contenteditable element:
function Editor(element, highlight) {
const listeners = []
const history = []
let at = -1, prev
// Debounced highlighting
const debounceHighlight = debounce(30, () => {
const pos = save()
highlight(element)
restore(pos)
})
// Event handlers
on('keydown', event => { /* ... */ })
on('keyup', event => { /* ... */ })
on('paste', () => setTimeout(recordHistory, 10))
on('cut', () => setTimeout(recordHistory, 10))
return {
set(content) { /* ... */ },
undo() { /* ... */ },
redo() { /* ... */ },
destroy() { /* ... */ }
}
}
Saves and restores cursor position across DOM changes:
Records editor state for undo/redo:
Applies Markdown formatting:
parseMarkdown function| Shortcut | Action |
|---|---|
| Ctrl+Z | Undo |
| Ctrl+Y / Ctrl+Shift+Z | Redo |
| Ctrl+S | Save |
| Ctrl+N | New note |
| Ctrl+O | Import file |
plaintext-only mode to avoid HTML injectionbeforeinput eventsWhen extending the editor:
on()Work with the URL compression system in kheMessage. Use when modifying how content is stored in URLs, debugging encoding issues, or optimizing compression.
Add or improve Markdown parsing and rendering in kheMessage. Use when adding new Markdown syntax support, fixing formatting issues, or enhancing the text editor.
Work with QR code generation and display. Use when modifying QR functionality, fixing QR rendering, or adding QR features.
Customize or extend the theming system in kheMessage. Use when adding new themes, modifying colors, or enhancing theme switching.