for now I would recommend looking at slate.js or prosemirror because those have first class data models with nesting, they also have issues but I have more faith these issues can be resolved,.... avoid Quill.js, because it looks good on paper, but the devs are misleading users and they systematically delete issues instead of addressing them, like to paint a pretty picture... if you want to extend it's document model in any meaningful way you will get very stuck... there have been some really bad design decisions that have made upgrades almost impossible, it does not support blocks within blocks, and the delta format doesn't support nesting... a div within it's default p tag is not possible, so tables are not possible, a simple div is not possible even break handling is very very hard, br tags are wrapped in P tags which are blocks... you will find if you dig into the user extensions, they're all half baked because there are uncontrollable/uncurable issues with the basic structure on which bigger things can be built...perhaps it'll sort itself out with a rewrite in version 2.0. ... also consider CKEditor 5 when it hits.