| Fine, I'll build my own text editor(dbushell.com) | |
| 257 points by Alephinitesimal 8 days ago | 251 comments | |
tl;dr: A developer experiments with building a browser-based text editor, first trying `<canvas>` rendering (fast but inaccessible and lacking free features like selection and scrolling), then `contenteditable` with `plaintext-only` (better accessibility but performance degrades with size), and finally settling on `<textarea>` with a separate syntax-highlighting layer for best performance. Along the way they hit gotchas like spellcheck causing input latency, CSS `::highlight` bottlenecks, and UTF-16 string quirks with emoji, concluding they've got 90% of an editor with 1% of the features. | |
HN Discussion:
| |