by slver · 5y ago · 0 comments
The point being that there is no lack of options for building out such features. I'm not sure you'll ever get an editor to do it out-of-the-box, though, because everyone's needs are going to be different.
For example in Sciter I've added transactional DOM mutations feature
element.richtext.update(function(ctx) {
ctx.setAttribute(...)
ctx.removeNode(...)
ctx.wrapNode(...)
});
Such mutation is performed as single UNDOable operation.Also Sciter supports immediate mode painting a la ImGUI that helps a lot to make lightweight editing solutions.
The lack of needed API forced Google Docs to switch to Canvas based rendering and editing : https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...
Also HTML that is pasted from external sources (browsers, MS Office, etc.) gets "cannibalized" on pasting:
https://github.com/c-smile/sciter-sdk/blob/master/notepad/re...
with white listed tags and attributes.