Clean html so that it only holds what the editor can produce (MMO.editor.ALLOWED_TAGS).
function MMO.editor.sanitize(html, inline = false)
Namespace
MMO.editor
Everything that comes in goes through here: the initial content, `value`, a paste, a drop and the
source view. It is what keeps a paste from Word or from another site from bringing its fonts, classes
and scripts along -- and what keeps an `onerror=` or a `javascript:` link out of the page.
html
string|Node
the markup, or a node whose CONTENT is cleaned in place
inline = false
boolean
true to keep text formatting only (an [mmo-editor="inline"] region)
Where a range starts and ends inside a root, as child indexes: it can be put back on a copy of the same html (MMO.editor.History), where the nodes themselves are gone.
function MMO.editor.serializeRange(range, root)
Namespace
MMO.editor
range
Range
root
Node
returns
?{start: Array<number>, startOffset: number, end: Array<number>, endOffset: number