News for hackers. Stuff that matters.
Re:A SvelteKit template for building CMS-free editable websites by recrof on Wednesday April 05, 2023 @02:11PM (#35458264)
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.
Re:A SvelteKit template for building CMS-free editable websites by _mql on Wednesday April 05, 2023 @03:57PM (#35459610)
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...