Hacker News new | ask | show | jobs
by samwillis 1107 days ago
I believe most do use a DOM like structure for block level elements. For inline styling however they tend to not have separate nested nodes for each style (bold, italic, underline), and are closer to the old HTML4 <font> tag with multiple properties for each style and don't nest them. It makes for much simpler code.

The docs for ProseMirror are a brilliant insight into how many of these editors are designed. ProseMirror maintains its own document model in parallel to the html DOM and rectifies one to the other as either changes.

For realtime collaborative rich text editors take a look at PeriText, they have a brilliant article explaining the CRDT structures used.

https://prosemirror.net

https://www.inkandswitch.com/peritext/