4 ms·
Here is "DOM canibalizer" module from my HTML-NOTEPAD ( https://html-notepad.com https://html-notepad.com ) : https://github.com/c-smile/sciter-sdk/blob/master
by c-smile 8y ago
Here is "DOM canibalizer" module from my HTML-NOTEPAD ( https://html-notepad.com https://html-notepad.com ) :
https://github.com/c-smile/sciter-sdk/blob/master/notepad/res/htmlview/canonicalize-dom.tis https://github.com/c-smile/sciter-sdk/blob/master/notepad/re...
While it looks pretty simple it cleans MS Word and browser artifacts in pasted markup pretty well.
But I shall admit that such simplicity is possible only with sciter (that html-notepad is based on). E.g. that canonicalizeDOM gets called before the content appears in target document. So all this does not affect undo/redo stack, etc.