3 ms·
Who said anything about contenteditable or not having control over the content? The editor can have complete control and still store the document in markup rath
by spankalee 10y ago
Who said anything about contenteditable or not having control over the content? The editor can have complete control and still store the document in markup rather than JSON.
HTML offers a number of advantages over a custom json-based document module, not the least of which is interop. You'd never want to store Skates data model in a database in case you switch editors.
- pfooti 10y agoI agree that HTML format has some strengths, but if you're working with data in javascript, there's a lot of strengths to a json format as well. Personally, I do store json data in my database (in a jsonb postgres column, which gives me some query capabilities that aren't necessarily available operating on html strings in the database). I also agree, though, that this leads to some degree of lock-in. You'd have to write a transformer to convert to your new framework, but that's not particularly hard. Ultimately, though, the way I think about it is: react, angular, ember, vue all work by converting a JSON representation of state into a dom tree. So, an editor doesn't really need to be much different, as long as render times are fast, having an internal representation that's projected on to the DOM is a pretty common pattern.
- lukasbuenger 10y agoHTML or any other markup language for that matter is very hard to translate into a well-defined and predictable data structure. When working with content editors, this, to me at least, is a hard requirement.