Fixes the pathological handling of unmatched brackets, which could hang the
browser. Adds support for mailto: query params. Removes support for nested
parentheses in URLs, as these are rare. Adds comment with formatted version of
regex to make it easier to modify in future.
If the rich text view is inside an overflow:scroll, every time you add a link
or do something else that requires we programatically focus the editor it would
jump the scroll back to the top; very annoying.
If the content hasn't changed before an undo point is requested we ignore the
request, but the cursor position may have changed and users expect undo to
restore the cursor position immediately before the requested change was made.
So in this instance we now still record an undo state, but replace the previous
one if the content is unchanged.
The selectionchange event handler can only be registered on the document
but we are not interested in changes of focus/selection that happen
outside of the editor, so check we have focus before firing the update
path event.
ms html clipboard format CF_HTML handles table like below if we copy part of table.
it makes problem when copying table from ms product such as ie, excel, powerpoint then pasting to squire.
<TABLE BORDER>
<!--StartFragment-->
<TR><TD>Item 6</TD><TD>Item 7</TD></TR><TR><TD>Item 10</TD><TD>Item 11</TD></TR>
<!--EndFragment-->
</TABLE>
and
<TABLE BORDER><TR>
<!--StartFragment-->
<TD>Item</TD>
<!--EndFragment-->
</TR></TABLE>
https://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx#274
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
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>
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.