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 직업 분류 기준
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.
| 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()