Hacker News new | ask | show | jobs
by xnx 1164 days ago
Is contenteditable not widely used? Is it too limited? https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...
2 comments

contenteditable is pretty terrible if you want it to behave exactly the same on all browsers. that's why there are projects like CKeditor or TinyMCE.
Yes, the challenge is taming contenteditable. I'm using ProseMirror under the hood with custom models for <Plaintext> and <Richtext> editing, which you can adapt to your needs. One limitation (of ProseMiror) is that you don't have shared undo/redo across multiple editable areas. That's something we've solved with our own library Substance.js a while ago, but the API would be too verbose for this type of use-case, and we didn't reach that level of stability that ProseMirror has today. Web-based rich text editing is a very interesting space to watch, that imo affects web development in general.

I wrote about it here in more detail: https://letsken.com/michael/how-to-implement-a-web-based-ric...

The template linked uses contenteditable (through prosemirror) and builds on top of it