If an action modifies the selection while the editor is not focused, we cannot
immediately set it in the DOM as this triggers focus. So instead we cache it and
restore on focus. If getSelection is called before the editor is next focused,
we need to return this new selection, not the current DOM selection.
Fixes#259
* Data added to clipboard should now always be the same for cut as for copy
* Fixes bug when cutting across blocks, where not all parents would be included
in the data added to the clipboard
1. Fixes cursor position when deleting starting with a selection at beginning
of block.
2. Fixes block disappears when whole inline contents is deleted.
This allows any level of indentation for bullets. It does this by introducing
invalid HTML. In particular, you can make bullets like:
<ul>
<ul>
<li>foo</li>
</ul>
</ul>
This makes inline node detection count the TIME element as an inline element.
This was causing <br> to be inserted into a TIME element incorrectly via fixCursor.
ZWS are added when formats are added, however these are not cleaned up
if the format is changed. Now they will be cleaned up if they only
contain ZWS and no text.
The only time we don't want to restore selection is if the user explicitly
changes it, by clicking/touching a specific cursor point.
Fixes formatting commands in IE11, where the mutation event first between
calling editor.focus() and the focus event actually firing, rather than
after the focus event as in other browsers.
Because focus/blur events are fired synchonously, browsers can get confused if
UI code starts focusing other elements while inside a focus/blur handler, and
end up firing events in the wrong order which can cause infinite loops.
This change ensures we only get a focus/blur event when they really are
happening, and you always get one then the other.