Salvaging contentEditable
summary
Shows a JavaScript editor that stops trusting contentEditable and instead captures browser events, prevents defaults, and translates them into operations on a persistent document model. Uses requestAnimationFrame to batch DOM updates and a minimal diff to render changes. Implements collaborative sync by mapping positions with a position map so concurrent edits rebase cleanly. Claims this approach sidesteps roughly 80% of contentEditable quirks and provides predictable undo and accessibility-friendly behavior.
AI-written summary · about
