diff --git a/build/squire-raw.js b/build/squire-raw.js
index a7abd24..67eca32 100644
--- a/build/squire-raw.js
+++ b/build/squire-raw.js
@@ -1440,7 +1440,7 @@ var keyHandlers = {
// If this is a malformed bit of document or in a table;
// just play it safe and insert a
.
- if ( !block || /^T[HD]$/.test( block.nodeName ) ) {
+ if ( !block || event.shiftKey || /^T[HD]$/.test( block.nodeName ) ) {
// If inside an , move focus out
parent = getNearest( range.endContainer, root, 'A' );
if ( parent ) {
@@ -1522,6 +1522,11 @@ var keyHandlers = {
self.setSelection( range );
self._updatePath( range, true );
},
+
+ 'shift-enter': function ( self, event, range ) {
+ return self._keyHandlers.enter( self, event, range );
+ },
+
backspace: function ( self, event, range ) {
var root = self._root;
self._removeZWS();
diff --git a/build/squire.js b/build/squire.js
index 6db239e..71c42ce 100644
--- a/build/squire.js
+++ b/build/squire.js
@@ -1,2 +1,2 @@
-!function(e,t){"use strict";function n(e,t,n){this.root=this.currentNode=e,this.nodeType=t,this.filter=n||ce}function i(e,t){for(var n=e.length;n--;)if(!t(e[n]))return!1;return!0}function o(e){return e.nodeType===w&&!!ue[e.nodeName]}function r(e){switch(e.nodeType){case F:return pe;case w:case H:if(ae&&ve.has(e))return ve.get(e);break;default:return fe}var t;return t=i(e.childNodes,a)?he.test(e.nodeName)?pe:ge:me,ae&&ve.set(e,t),t}function a(e){return r(e)===pe}function s(e){return r(e)===ge}function d(e){return r(e)===me}function l(e,t){var i=new n(t,W,s);return i.currentNode=e,i}function c(e,t){return e=l(e,t).previousNode(),e!==t?e:null}function h(e,t){return e=l(e,t).nextNode(),e!==t?e:null}function u(e){return!e.textContent&&!e.querySelector("IMG")}function f(e,t){return!o(e)&&e.nodeType===t.nodeType&&e.nodeName===t.nodeName&&"A"!==e.nodeName&&e.className===t.className&&(!e.style&&!t.style||e.style.cssText===t.style.cssText)}function p(e,t,n){if(e.nodeName!==t)return!1;for(var i in n)if(e.getAttribute(i)!==n[i])return!1;return!0}function g(e,t,n,i){for(;e&&e!==t;){if(p(e,n,i))return e;e=e.parentNode}return null}function m(e,t){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function v(e,t,n){var i,o,r,a,s,d="";return e&&e!==t&&(d=v(e.parentNode,t,n),e.nodeType===w&&(d+=(d?">":"")+e.nodeName,(i=e.id)&&(d+="#"+i),(o=e.className.trim())&&(r=o.split(/\s\s*/),r.sort(),d+=".",d+=r.join(".")),(a=e.dir)&&(d+="[dir="+a+"]"),r&&(s=n.classNames,de.call(r,s.highlight)>-1&&(d+="[backgroundColor="+e.style.backgroundColor.replace(/ /g,"")+"]"),de.call(r,s.colour)>-1&&(d+="[color="+e.style.color.replace(/ /g,"")+"]"),de.call(r,s.fontFamily)>-1&&(d+="[fontFamily="+e.style.fontFamily.replace(/ /g,"")+"]"),de.call(r,s.fontSize)>-1&&(d+="[fontSize="+e.style.fontSize+"]")))),d}function _(e){var t=e.nodeType;return t===w||t===H?e.childNodes.length:e.length||0}function N(e){var t=e.parentNode;return t&&t.removeChild(e),e}function C(e,t){var n=e.parentNode;n&&n.replaceChild(t,e)}function S(e){for(var t=e.ownerDocument.createDocumentFragment(),n=e.childNodes,i=n?n.length:0;i--;)t.appendChild(e.firstChild);return t}function y(e,n,i,o){var r,a,s,d=e.createElement(n);if(i instanceof Array&&(o=i,i=null),i)for(r in i)i[r]!==t&&d.setAttribute(r,i[r]);if(o)for(a=0,s=o.length;as?t.startOffset-=1:t.startOffset===s&&(t.startContainer=i,t.startOffset=_(i))),t.endContainer===e&&(t.endOffset>s?t.endOffset-=1:t.endOffset===s&&(t.endContainer=i,t.endOffset=_(i))),N(n),n.nodeType===F?i.appendData(n.data):d.push(S(n));else if(n.nodeType===w){for(o=d.length;o--;)n.appendChild(d.pop());k(n,t)}}function L(e,t){if(e.nodeType===F&&(e=e.parentNode),e.nodeType===w){var n={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};k(e,n),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset)}}function x(e,t,n,i){for(var o,r,a,s=t;(o=s.parentNode)&&o!==i&&o.nodeType===w&&1===o.childNodes.length;)s=o;N(s),a=e.childNodes.length,r=e.lastChild,r&&"BR"===r.nodeName&&(e.removeChild(r),a-=1),e.appendChild(S(t)),n.setStart(e,a),n.collapse(!0),L(e,n),Y&&(r=e.lastChild)&&"BR"===r.nodeName&&e.removeChild(r)}function A(e,t){var n,i,o=e.previousSibling,r=e.firstChild,a=e.ownerDocument,s="LI"===e.nodeName;if(!s||r&&/^[OU]L$/.test(r.nodeName))if(o&&f(o,e)){if(!d(o)){if(!s)return;i=y(a,"DIV"),i.appendChild(S(o)),o.appendChild(i)}N(e),n=!d(e),o.appendChild(S(e)),n&&E(o,t),r&&A(r,t)}else s&&(o=y(a,"DIV"),e.insertBefore(o,r),T(o,t))}function O(e){this.isShiftDown=e.shiftKey}function B(e,t,n){var i,o;if(e||(e={}),t)for(i in t)!n&&i in e||(o=t[i],e[i]=o&&o.constructor===Object?B(e[i],o,n):o);return e}function R(e,t){e.nodeType===M&&(e=e.body);var n,i=e.ownerDocument,o=i.defaultView;this._win=o,this._doc=i,this._root=e,this._events={},this._isFocused=!1,this._lastSelection=null,oe&&this.addEventListener("beforedeactivate",this.getSelection),this._hasZWS=!1,this._lastAnchorNode=null,this._lastFocusNode=null,this._path="",this._willUpdatePath=!1,"onselectionchange"in i?this.addEventListener("selectionchange",this._updatePathOnEvent):(this.addEventListener("keyup",this._updatePathOnEvent),this.addEventListener("mouseup",this._updatePathOnEvent)),this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0,this._isInUndoState=!1,this._ignoreChange=!1,this._ignoreAllChanges=!1,re?(n=new MutationObserver(this._docWasChanged.bind(this)),n.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._mutation=n):this.addEventListener("keyup",this._keyUpDetectChange),this._restoreSelection=!1,this.addEventListener("blur",D),this.addEventListener("mousedown",U),this.addEventListener("touchstart",U),this.addEventListener("focus",P),this._awaitingPaste=!1,this.addEventListener(V?"beforecut":"cut",Je),this.addEventListener("copy",et),this.addEventListener("keydown",O),this.addEventListener("keyup",O),this.addEventListener(V?"beforepaste":"paste",tt),this.addEventListener("drop",nt),this.addEventListener(Y?"keypress":"keydown",Ue),this._keyHandlers=Object.create(Fe),this.setConfig(t),V&&(o.Text.prototype.splitText=function(e){var t=this.ownerDocument.createTextNode(this.data.slice(e)),n=this.nextSibling,i=this.parentNode,o=this.length-e;return n?i.insertBefore(t,n):i.appendChild(t),o&&this.deleteData(e,o),t}),e.setAttribute("contenteditable","true");try{i.execCommand("enableObjectResizing",!1,"false"),i.execCommand("enableInlineTableEditing",!1,"false")}catch(e){}e.__squire__=this,this.setHTML("")}function D(){this._restoreSelection=!0}function U(){this._restoreSelection=!1}function P(){this._restoreSelection&&this.setSelection(this._lastSelection)}function I(e,t,n){var i,o;for(i=t.firstChild;i;i=o){if(o=i.nextSibling,a(i)){if(i.nodeType===F||"BR"===i.nodeName||"IMG"===i.nodeName){n.appendChild(i);continue}}else if(s(i)){n.appendChild(e.createDefaultBlock([I(e,i,e._doc.createDocumentFragment())]));continue}I(e,i,n)}return n}var w=1,F=3,M=9,H=11,W=1,z="",q=e.defaultView,K=navigator.userAgent,G=/Android/.test(K),Z=/iP(?:ad|hone|od)/.test(K),j=/Mac OS X/.test(K),$=/Windows NT/.test(K),Q=/Gecko\//.test(K),V=/Trident\/[456]\./.test(K),Y=!!q.opera,X=/Edge\//.test(K),J=!X&&/WebKit\//.test(K),ee=/Trident\/[4567]\./.test(K),te=j?"meta-":"ctrl-",ne=V||Y,ie=V||J,oe=V,re="undefined"!=typeof MutationObserver,ae="undefined"!=typeof WeakMap,se=/[^ \t\r\n]/,de=Array.prototype.indexOf;Object.create||(Object.create=function(e){var t=function(){};return t.prototype=e,new t});var le={1:1,2:2,3:4,8:128,9:256,11:1024},ce=function(){return!0};n.prototype.nextNode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){for(e=t.firstChild;!e&&t&&t!==n;)(e=t.nextSibling)||(t=t.parentNode);if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}},n.prototype.previousNode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){if(t===n)return null;if(e=t.previousSibling)for(;t=e.lastChild;)e=t;else e=t.parentNode;if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}},n.prototype.previousPONode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){for(e=t.lastChild;!e&&t&&t!==n;)(e=t.previousSibling)||(t=t.parentNode);if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}};var he=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|HR|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,ue={BR:1,HR:1,IFRAME:1,IMG:1,INPUT:1},fe=0,pe=1,ge=2,me=3,ve=ae?new WeakMap:null,_e=function(e,t){for(var n=e.childNodes;t&&e.nodeType===w;)e=n[t-1],n=e.childNodes,t=n.length;return e},Ne=function(e,t){if(e.nodeType===w){var n=e.childNodes;if(t-1,r=e.compareBoundaryPoints(1,i)<1;return!o&&!r}var a=e.compareBoundaryPoints(0,i)<1,s=e.compareBoundaryPoints(2,i)>-1;return a&&s},be=function(e){for(var t,n=e.startContainer,i=e.startOffset,r=e.endContainer,a=e.endOffset,s=!0;n.nodeType!==F&&(t=n.childNodes[i])&&!o(t);)n=t,i=0;if(a)for(;r.nodeType!==F;){if(!(t=r.childNodes[a-1])||o(t)){if(s&&t&&"BR"===t.nodeName){a-=1,s=!1;continue}break}r=t,a=_(r)}else for(;r.nodeType!==F&&(t=r.firstChild)&&!o(t);)r=t;e.collapsed?(e.setStart(r,a),e.setEnd(n,i)):(e.setStart(n,i),e.setEnd(r,a))},ke=function(e,t,n,i){var o,r=e.startContainer,a=e.startOffset,s=e.endContainer,d=e.endOffset,l=!0;for(t||(t=e.commonAncestorContainer),n||(n=t);!a&&r!==t&&r!==i;)o=r.parentNode,a=de.call(o.childNodes,r),r=o;for(;;){if(l&&s.nodeType!==F&&s.childNodes[d]&&"BR"===s.childNodes[d].nodeName&&(d+=1,l=!1),s===n||s===i||d!==_(s))break;o=s.parentNode,d=de.call(o.childNodes,s)+1,s=o}e.setStart(r,a),e.setEnd(s,d)},Le=function(e,t){var n,i=e.startContainer;return a(i)?n=c(i,t):i!==t&&s(i)?n=i:(n=_e(i,e.startOffset),n=h(n,t)),n&&Ee(e,n,!0)?n:null},xe=function(e,t){var n,i,o=e.endContainer;if(a(o))n=c(o,t);else if(o!==t&&s(o))n=o;else{if(!(n=Ne(o,e.endOffset))||!m(t,n))for(n=t;i=n.lastChild;)n=i;n=c(n,t)}return n&&Ee(e,n,!0)?n:null},Ae=new n(null,4|W,function(e){return e.nodeType===F?se.test(e.data):"IMG"===e.nodeName}),Oe=function(e,t){var n,i=e.startContainer,o=e.startOffset;if(Ae.root=null,i.nodeType===F){if(o)return!1;n=i}else if(n=Ne(i,o),n&&!m(t,n)&&(n=null),!n&&(n=_e(i,o),n.nodeType===F&&n.length))return!1;return Ae.currentNode=n,Ae.root=Le(e,t),!Ae.previousNode()},Be=function(e,t){var n,i=e.endContainer,o=e.endOffset;if(Ae.root=null,i.nodeType===F){if((n=i.data.length)&&o-1||!Q&&de.call(o,"text/plain")>-1&&de.call(o,"text/rtf")<0))return e.preventDefault(),void(!d&&(r=a.getData("text/html"))?this.insertHTML(r,!0):((r=a.getData("text/plain"))||(r=a.getData("text/uri-list")))&&this.insertPlainText(r,!0));this._awaitingPaste=!0;var f=this._doc.body,p=this.getSelection(),g=p.startContainer,m=p.startOffset,v=p.endContainer,_=p.endOffset,C=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});f.appendChild(C),p.selectNodeContents(C),this.setSelection(p),setTimeout(function(){try{u._awaitingPaste=!1;for(var e,t,n="",i=C;C=i;)i=C.nextSibling,N(C),e=C.firstChild,e&&e===C.lastChild&&"DIV"===e.nodeName&&(C=e),n+=C.innerHTML;t=u.createRange(g,m,v,_),u.setSelection(t),n&&u.insertHTML(n,!0)}catch(e){u.didError(e)}},0)},nt=function(e){for(var t=e.dataTransfer.types,n=t.length,i=!1,o=!1;n--;)switch(t[n]){case"text/plain":i=!0;break;case"text/html":o=!0;break;default:return}(o||i)&&this.saveUndoState()},it=R.prototype,ot=function(e,t,n){var i=n._doc,o=e?DOMPurify.sanitize(e,{ALLOW_UNKNOWN_PROTOCOLS:!0,WHOLE_DOCUMENT:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0}):null;return o?i.importNode(o,!0):i.createDocumentFragment()};it.setConfig=function(e){return e=B({blockTag:"DIV",blockAttributes:null,tagAttributes:{blockquote:null,ul:null,ol:null,li:null,a:null},classNames:{colour:"colour",fontFamily:"font",fontSize:"size",highlight:"highlight"},leafNodeNames:ue,undo:{documentSizeThreshold:-1,undoLimit:-1},isInsertedHTMLSanitized:!0,isSetHTMLSanitized:!0,sanitizeToDOMFragment:"undefined"!=typeof DOMPurify&&DOMPurify.isSupported?ot:null,willCutCopy:null},e,!0),e.blockTag=e.blockTag.toUpperCase(),this._config=e,this},it.createElement=function(e,t,n){return y(this._doc,e,t,n)},it.createDefaultBlock=function(e){var t=this._config;return T(this.createElement(t.blockTag,t.blockAttributes,e),this._root)},it.didError=function(e){console.log(e)},it.getDocument=function(){return this._doc},it.getRoot=function(){return this._root},it.modifyDocument=function(e){var t=this._mutation;t&&(t.takeRecords().length&&this._docWasChanged(),t.disconnect()),this._ignoreAllChanges=!0,e(),this._ignoreAllChanges=!1,t&&(t.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._ignoreChange=!1)};var rt={pathChange:1,select:1,input:1,undoStateChange:1};it.fireEvent=function(e,t){var n,i,o,r=this._events[e];if(/^(?:focus|blur)/.test(e))if(n=this._root===this._doc.activeElement,"focus"===e){if(!n||this._isFocused)return this;this._isFocused=!0}else{if(n||!this._isFocused)return this;this._isFocused=!1}if(r)for(t||(t={}),t.type!==e&&(t.type=e),r=r.slice(),i=r.length;i--;){o=r[i];try{o.handleEvent?o.handleEvent(t):o.call(this,t)}catch(t){t.details="Squire: fireEvent error. Event type: "+e,this.didError(t)}}return this},it.destroy=function(){var e,t=this._events;for(e in t)this.removeEventListener(e);this._mutation&&this._mutation.disconnect(),delete this._root.__squire__,this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0},it.handleEvent=function(e){this.fireEvent(e.type,e)},it.addEventListener=function(e,t){var n=this._events[e],i=this._root;return t?(n||(n=this._events[e]=[],rt[e]||("selectionchange"===e&&(i=this._doc),i.addEventListener(e,this,!0))),n.push(t),this):(this.didError({name:"Squire: addEventListener with null or undefined fn",message:"Event type: "+e}),this)},it.removeEventListener=function(e,t){var n,i=this._events[e],o=this._root;if(i){if(t)for(n=i.length;n--;)i[n]===t&&i.splice(n,1);else i.length=0;i.length||(delete this._events[e],rt[e]||("selectionchange"===e&&(o=this._doc),o.removeEventListener(e,this,!0)))}return this},it.createRange=function(e,t,n,i){if(e instanceof this._win.Range)return e.cloneRange();var o=this._doc.createRange();return o.setStart(e,t),n?o.setEnd(n,i):o.setEnd(e,t),o},it.getCursorPosition=function(e){if(!e&&!(e=this.getSelection())||!e.getBoundingClientRect)return null;var t,n,i=e.getBoundingClientRect();return i&&!i.top&&(this._ignoreChange=!0,t=this._doc.createElement("SPAN"),t.textContent=z,Ce(e,t),i=t.getBoundingClientRect(),n=t.parentNode,n.removeChild(t),L(n,e)),i},it._moveCursorTo=function(e){var t=this._root,n=this.createRange(t,e?0:t.childNodes.length);return be(n),this.setSelection(n),this},it.moveCursorToStart=function(){return this._moveCursorTo(!0)},it.moveCursorToEnd=function(){return this._moveCursorTo(!1)};var at=function(e){return e._win.getSelection()||null};it.setSelection=function(e){if(e)if(this._lastSelection=e,this._isFocused)if(G&&!this._restoreSelection)D.call(this),this.blur(),this.focus();else{Z&&this._win.focus();var t=at(this);t&&(t.removeAllRanges(),t.addRange(e))}else D.call(this);return this},it.getSelection=function(){var e,t,n,i,r=at(this),a=this._root;return this._isFocused&&r&&r.rangeCount&&(e=r.getRangeAt(0).cloneRange(),t=e.startContainer,n=e.endContainer,t&&o(t)&&e.setStartBefore(t),n&&o(n)&&e.setEndBefore(n)),e&&m(a,e.commonAncestorContainer)?this._lastSelection=e:(e=this._lastSelection,i=e.commonAncestorContainer,m(i.ownerDocument,i)||(e=null)),e||(e=this.createRange(a.firstChild,0)),e},it.getSelectedText=function(){var e=this.getSelection();if(!e||e.collapsed)return"";var t,i=new n(e.commonAncestorContainer,4|W,function(t){return Ee(e,t,!0)}),o=e.startContainer,r=e.endContainer,s=i.currentNode=o,d="",l=!1;for(i.filter(s)||(s=i.nextNode());s;)s.nodeType===F?(t=s.data)&&/\S/.test(t)&&(s===r&&(t=t.slice(0,e.endOffset)),s===o&&(t=t.slice(e.startOffset)),d+=t,l=!0):("BR"===s.nodeName||l&&!a(s))&&(d+="\n",l=!1),s=i.nextNode();return d},it.getPath=function(){return this._path};var st=function(e,t){for(var i,o,r,s=new n(e,4);o=s.nextNode();)for(;(r=o.data.indexOf(z))>-1&&(!t||o.parentNode!==t);){if(1===o.length){do{i=o.parentNode,i.removeChild(o),o=i,s.currentNode=i}while(a(o)&&!_(o));break}o.deleteData(r,1)}};it._didAddZWS=function(){this._hasZWS=!0},it._removeZWS=function(){this._hasZWS&&(st(this._root),this._hasZWS=!1)},it._updatePath=function(e,t){if(e){var n,i=e.startContainer,o=e.endContainer;(t||i!==this._lastAnchorNode||o!==this._lastFocusNode)&&(this._lastAnchorNode=i,this._lastFocusNode=o,n=i&&o?i===o?v(o,this._root,this._config):"(selection)":"",this._path!==n&&(this._path=n,this.fireEvent("pathChange",{path:n}))),this.fireEvent(e.collapsed?"cursor":"select",{range:e})}},it._updatePathOnEvent=function(e){var t=this;t._isFocused&&!t._willUpdatePath&&(t._willUpdatePath=!0,setTimeout(function(){t._willUpdatePath=!1,t._updatePath(t.getSelection())},0))},it.focus=function(){return this._root.focus(),ee&&this.fireEvent("focus"),this},it.blur=function(){return this._root.blur(),ee&&this.fireEvent("blur"),this};var dt="squire-selection-end";it._saveRangeToBookmark=function(e){var t,n=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),i=this.createElement("INPUT",{id:dt,type:"hidden"});Ce(e,n),e.collapse(!1),Ce(e,i),2&n.compareDocumentPosition(i)&&(n.id=dt,i.id="squire-selection-start",t=n,n=i,i=t),e.setStartAfter(n),e.setEndBefore(i)},it._getRangeAndRemoveBookmark=function(e){var t=this._root,n=t.querySelector("#squire-selection-start"),i=t.querySelector("#"+dt);if(n&&i){var o=n.parentNode,r=i.parentNode,a=de.call(o.childNodes,n),s=de.call(r.childNodes,i);o===r&&(s-=1),N(n),N(i),e||(e=this._doc.createRange()),e.setStart(o,a),e.setEnd(r,s),L(o,e),o!==r&&L(r,e),e.collapsed&&(o=e.startContainer,o.nodeType===F&&(r=o.childNodes[e.startOffset],r&&r.nodeType===F||(r=o.childNodes[e.startOffset-1]),
-r&&r.nodeType===F&&(e.setStart(r,0),e.collapse(!0))))}return e||null},it._keyUpDetectChange=function(e){var t=e.keyCode;e.ctrlKey||e.metaKey||e.altKey||!(t<16||t>20)||!(t<33||t>45)||this._docWasChanged()},it._docWasChanged=function(){if(ae&&(ve=new WeakMap),!this._ignoreAllChanges){if(re&&this._ignoreChange)return void(this._ignoreChange=!1);this._isInUndoState&&(this._isInUndoState=!1,this.fireEvent("undoStateChange",{canUndo:!0,canRedo:!1})),this.fireEvent("input")}},it._recordUndoState=function(e,t){if(!this._isInUndoState||t){var n,i=this._undoIndex,o=this._undoStack,r=this._config.undo,a=r.documentSizeThreshold,s=r.undoLimit;t||(i+=1),i-1&&2*n.length>a&&s>-1&&i>s&&(o.splice(0,i-s),i=s,this._undoStackLength=s),o[i]=n,this._undoIndex=i,this._undoStackLength+=1,this._isInUndoState=!0}},it.saveUndoState=function(e){return e===t&&(e=this.getSelection()),this._recordUndoState(e,this._isInUndoState),this._getRangeAndRemoveBookmark(e),this},it.undo=function(){if(0!==this._undoIndex||!this._isInUndoState){this._recordUndoState(this.getSelection(),!1),this._undoIndex-=1,this._setHTML(this._undoStack[this._undoIndex]);var e=this._getRangeAndRemoveBookmark();e&&this.setSelection(e),this._isInUndoState=!0,this.fireEvent("undoStateChange",{canUndo:0!==this._undoIndex,canRedo:!0}),this.fireEvent("input")}return this},it.redo=function(){var e=this._undoIndex,t=this._undoStackLength;if(e+1c&&h.splitText(c),h===s&&l&&(h=h.splitText(l),d===s&&(d=h,c-=l),s=h,l=0),o=this.createElement(e,t),C(h,o),o.appendChild(h))}while(r.nextNode());d.nodeType!==F&&(h.nodeType===F?(d=h,c=h.length):(d=h.parentNode,c=1)),i=this.createRange(s,l,d,c)}return i},it._removeFormat=function(e,t,n,i){this._saveRangeToBookmark(n);var o,r=this._doc;n.collapsed&&(ie?(o=r.createTextNode(z),this._didAddZWS()):o=r.createTextNode(""),Ce(n,o));for(var s=n.commonAncestorContainer;a(s);)s=s.parentNode;var d=n.startContainer,l=n.startOffset,c=n.endContainer,h=n.endOffset,u=[],f=function(e,t){if(!Ee(n,e,!1)){var i,o,r=e.nodeType===F;if(!Ee(n,e,!0))return void("INPUT"===e.nodeName||r&&!e.data||u.push([t,e]));if(r)e===c&&h!==e.length&&u.push([t,e.splitText(h)]),e===d&&l&&(e.splitText(l),u.push([t,e]));else for(i=e.firstChild;i;i=o)o=i.nextSibling,f(i,t)}},g=Array.prototype.filter.call(s.getElementsByTagName(e),function(i){return Ee(n,i,!0)&&p(i,e,t)});return i||g.forEach(function(e){f(e,e)}),u.forEach(function(e){var t=e[0].cloneNode(!1),n=e[1];C(n,t),t.appendChild(n)}),g.forEach(function(e){C(e,S(e))}),this._getRangeAndRemoveBookmark(n),o&&n.collapse(!1),L(s,n),n},it.changeFormat=function(e,t,n,i){return n||(n=this.getSelection())?(this.saveUndoState(n),t&&(n=this._removeFormat(t.tag.toUpperCase(),t.attributes||{},n,i)),e&&(n=this._addFormat(e.tag.toUpperCase(),e.attributes||{},n)),this.setSelection(n),this._updatePath(n,!0),re||this._docWasChanged(),this):this};var lt={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"},ct=function(e,t,n,i){var o=lt[t.nodeName],r=null,a=b(n,i,t.parentNode,e._root),s=e._config;return o||(o=s.blockTag,r=s.blockAttributes),p(a,o,r)||(t=y(a.ownerDocument,o,r),a.dir&&(t.dir=a.dir),C(a,t),t.appendChild(S(a)),a=t),a};it.forEachBlock=function(e,t,n){if(!n&&!(n=this.getSelection()))return this;t&&this.saveUndoState(n);var i=this._root,o=Le(n,i),r=xe(n,i);if(o&&r)do{if(e(o)||o===r)break}while(o=h(o,i));return t&&(this.setSelection(n),this._updatePath(n,!0),re||this._docWasChanged()),this},it.modifyBlocks=function(e,t){if(!t&&!(t=this.getSelection()))return this;this._recordUndoState(t,this._isInUndoState);var n,i=this._root;return Re(t,i),ke(t,i,i,i),n=Se(t,i,i),Ce(t,e.call(this,n)),t.endOffset]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i,Ct=function(e,t,i){for(var o,r,a,s,d,l,c,h=e.ownerDocument,u=new n(e,4,function(e){return!g(e,t,"A")}),f=i._config.tagAttributes.a;o=u.nextNode();)for(r=o.data,a=o.parentNode;s=Nt.exec(r);)d=s.index,l=d+s[0].length,d&&(c=h.createTextNode(r.slice(0,d)),a.insertBefore(c,o)),c=i.createElement("A",B({href:s[1]?/^(?:ht|f)tps?:/i.test(s[1])?s[1]:"http://"+s[1]:"mailto:"+s[0]},f,!1)),c.textContent=r.slice(d,l),a.insertBefore(c,o),o.data=r=r.slice(l)};it.insertHTML=function(e,t){var n,i,o,r,a,s,d,l=this._config,c=l.isInsertedHTMLSanitized?l.sanitizeToDOMFragment:null,u=this.getSelection(),f=this._doc;"function"==typeof c?r=c(e,t,this):(t&&(n=e.indexOf("\x3c!--StartFragment--\x3e"),i=e.lastIndexOf("\x3c!--EndFragment--\x3e"),n>-1&&i>-1&&(e=e.slice(n+20,i))),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e=""+e+"
"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e=""),o=this.createElement("DIV"),o.innerHTML=e,r=f.createDocumentFragment(),r.appendChild(S(o))),this.saveUndoState(u);try{for(a=this._root,s=r,d={fragment:r,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},Ct(r,r,this),je(r,l),Ye(r,a,!1),$e(r),r.normalize();s=h(s,r);)T(s,a);t&&this.fireEvent("willPaste",d),d.defaultPrevented||(Te(u,d.fragment,a),re||this._docWasChanged(),u.collapse(!1),this._ensureBottomLine()),this.setSelection(u),this._updatePath(u,!0),t&&this.focus()}catch(e){this.didError(e)}return this};var St=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")};it.insertPlainText=function(e,t){var n,i,o,r,a=e.split("\n"),s=this._config,d=s.blockTag,l=s.blockAttributes,c=""+d+">",h="<"+d;for(n in l)h+=" "+n+'="'+St(l[n])+'"';for(h+=">",i=0,o=a.length;i")+c;return this.insertHTML(a.join(""),t)};var yt=function(e,t,n){return function(){return this[e](t,n),this.focus()}};it.addStyles=function(e){if(e){var t=this._doc.documentElement.firstChild,n=this.createElement("STYLE",{type:"text/css"});n.appendChild(this._doc.createTextNode(e)),t.appendChild(n)}return this},it.bold=yt("changeFormat",{tag:"B"}),it.italic=yt("changeFormat",{tag:"I"}),it.underline=yt("changeFormat",{tag:"U"}),it.strikethrough=yt("changeFormat",{tag:"S"}),it.subscript=yt("changeFormat",{tag:"SUB"},{tag:"SUP"}),it.superscript=yt("changeFormat",{tag:"SUP"},{tag:"SUB"}),it.removeBold=yt("changeFormat",null,{tag:"B"}),it.removeItalic=yt("changeFormat",null,{tag:"I"}),it.removeUnderline=yt("changeFormat",null,{tag:"U"}),it.removeStrikethrough=yt("changeFormat",null,{tag:"S"}),it.removeSubscript=yt("changeFormat",null,{tag:"SUB"}),it.removeSuperscript=yt("changeFormat",null,{tag:"SUP"}),it.makeLink=function(e,t){var n=this.getSelection();if(n.collapsed){var i=e.indexOf(":")+1;if(i)for(;"/"===e[i];)i+=1;Ce(n,this._doc.createTextNode(e.slice(i)))}return t=B(B({href:e},t,!0),this._config.tagAttributes.a,!1),this.changeFormat({tag:"A",attributes:t},{tag:"A"},n),this.focus()},it.removeLink=function(){return this.changeFormat(null,{tag:"A"},this.getSelection(),!0),this.focus()},it.setFontFace=function(e){var t=this._config.classNames.fontFamily;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"font-family: "+e+", sans-serif;"}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setFontSize=function(e){var t=this._config.classNames.fontSize;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"font-size: "+("number"==typeof e?e+"px":e)}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setTextColour=function(e){var t=this._config.classNames.colour;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"color:"+e}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setHighlightColour=function(e){var t=this._config.classNames.highlight;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"background-color:"+e}}:e,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setTextAlignment=function(e){return this.forEachBlock(function(t){var n=t.className.split(/\s+/).filter(function(e){return!!e&&!/^align/.test(e)}).join(" ");e?(t.className=n+" align-"+e,t.style.textAlign=e):(t.className=n,t.style.textAlign="")},!0),this.focus()},it.setTextDirection=function(e){return this.forEachBlock(function(t){e?t.dir=e:t.removeAttribute("dir")},!0),this.focus()},it.removeAllFormatting=function(e){if(!e&&!(e=this.getSelection())||e.collapsed)return this;for(var t=this._root,n=e.commonAncestorContainer;n&&!s(n);)n=n.parentNode;if(n||(Re(e,t),n=t),n.nodeType===F)return this;this.saveUndoState(e),ke(e,n,n,t);for(var i,o,r=n.ownerDocument,a=e.startContainer,d=e.startOffset,l=e.endContainer,c=e.endOffset,h=r.createDocumentFragment(),u=r.createDocumentFragment(),f=b(l,c,n,t),p=b(a,d,n,t);p!==f;)i=p.nextSibling,h.appendChild(p),p=i;return I(this,h,u),u.normalize(),p=u.firstChild,i=u.lastChild,o=n.childNodes,p?(n.insertBefore(u,f),d=de.call(o,p),c=de.call(o,i)+1):(d=de.call(o,f),c=d),e.setStart(n,d),e.setEnd(n,c),L(n,e),be(e),this.setSelection(e),this._updatePath(e,!0),this.focus()},it.increaseQuoteLevel=yt("modifyBlocks",ht),it.decreaseQuoteLevel=yt("modifyBlocks",ut),it.makeUnorderedList=yt("modifyBlocks",gt),it.makeOrderedList=yt("modifyBlocks",mt),it.removeList=yt("modifyBlocks",vt),R.isInline=a,R.isBlock=s,R.isContainer=d,R.getBlockWalker=l,R.getPreviousBlock=c,R.getNextBlock=h,R.areAlike=f,R.hasTagAttributes=p,R.getNearest=g,R.isOrContains=m,R.detach=N,R.replaceWith=C,R.empty=S,R.getNodeBefore=_e,R.getNodeAfter=Ne,R.insertNodeInRange=Ce,R.extractContentsOfRange=Se,R.deleteContentsOfRange=ye,R.insertTreeFragmentIntoRange=Te,R.isNodeContainedInRange=Ee,R.moveRangeBoundariesDownTree=be,R.moveRangeBoundariesUpTree=ke,R.getStartBlockOfRange=Le,R.getEndBlockOfRange=xe,R.contentWalker=Ae,R.rangeDoesStartAtBlockBoundary=Oe,R.rangeDoesEndAtBlockBoundary=Be,R.expandRangeToBlockBoundaries=Re,R.onPaste=tt,R.addLinks=Ct,R.splitBlock=ct,R.startSelectionId="squire-selection-start",R.endSelectionId=dt,"object"==typeof exports?module.exports=R:"function"==typeof define&&define.amd?define(function(){return R}):(q.Squire=R,top!==q&&"true"===e.documentElement.getAttribute("data-squireinit")&&(q.editor=new R(e),q.onEditorLoad&&(q.onEditorLoad(q.editor),q.onEditorLoad=null)))}(document);
\ No newline at end of file
+!function(e,t){"use strict";function n(e,t,n){this.root=this.currentNode=e,this.nodeType=t,this.filter=n||ce}function i(e,t){for(var n=e.length;n--;)if(!t(e[n]))return!1;return!0}function o(e){return e.nodeType===w&&!!ue[e.nodeName]}function r(e){switch(e.nodeType){case F:return pe;case w:case H:if(ae&&ve.has(e))return ve.get(e);break;default:return fe}var t;return t=i(e.childNodes,a)?he.test(e.nodeName)?pe:ge:me,ae&&ve.set(e,t),t}function a(e){return r(e)===pe}function s(e){return r(e)===ge}function d(e){return r(e)===me}function l(e,t){var i=new n(t,W,s);return i.currentNode=e,i}function c(e,t){return e=l(e,t).previousNode(),e!==t?e:null}function h(e,t){return e=l(e,t).nextNode(),e!==t?e:null}function u(e){return!e.textContent&&!e.querySelector("IMG")}function f(e,t){return!o(e)&&e.nodeType===t.nodeType&&e.nodeName===t.nodeName&&"A"!==e.nodeName&&e.className===t.className&&(!e.style&&!t.style||e.style.cssText===t.style.cssText)}function p(e,t,n){if(e.nodeName!==t)return!1;for(var i in n)if(e.getAttribute(i)!==n[i])return!1;return!0}function g(e,t,n,i){for(;e&&e!==t;){if(p(e,n,i))return e;e=e.parentNode}return null}function m(e,t){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function v(e,t,n){var i,o,r,a,s,d="";return e&&e!==t&&(d=v(e.parentNode,t,n),e.nodeType===w&&(d+=(d?">":"")+e.nodeName,(i=e.id)&&(d+="#"+i),(o=e.className.trim())&&(r=o.split(/\s\s*/),r.sort(),d+=".",d+=r.join(".")),(a=e.dir)&&(d+="[dir="+a+"]"),r&&(s=n.classNames,de.call(r,s.highlight)>-1&&(d+="[backgroundColor="+e.style.backgroundColor.replace(/ /g,"")+"]"),de.call(r,s.colour)>-1&&(d+="[color="+e.style.color.replace(/ /g,"")+"]"),de.call(r,s.fontFamily)>-1&&(d+="[fontFamily="+e.style.fontFamily.replace(/ /g,"")+"]"),de.call(r,s.fontSize)>-1&&(d+="[fontSize="+e.style.fontSize+"]")))),d}function _(e){var t=e.nodeType;return t===w||t===H?e.childNodes.length:e.length||0}function N(e){var t=e.parentNode;return t&&t.removeChild(e),e}function C(e,t){var n=e.parentNode;n&&n.replaceChild(t,e)}function S(e){for(var t=e.ownerDocument.createDocumentFragment(),n=e.childNodes,i=n?n.length:0;i--;)t.appendChild(e.firstChild);return t}function y(e,n,i,o){var r,a,s,d=e.createElement(n);if(i instanceof Array&&(o=i,i=null),i)for(r in i)i[r]!==t&&d.setAttribute(r,i[r]);if(o)for(a=0,s=o.length;as?t.startOffset-=1:t.startOffset===s&&(t.startContainer=i,t.startOffset=_(i))),t.endContainer===e&&(t.endOffset>s?t.endOffset-=1:t.endOffset===s&&(t.endContainer=i,t.endOffset=_(i))),N(n),n.nodeType===F?i.appendData(n.data):d.push(S(n));else if(n.nodeType===w){for(o=d.length;o--;)n.appendChild(d.pop());k(n,t)}}function L(e,t){if(e.nodeType===F&&(e=e.parentNode),e.nodeType===w){var n={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};k(e,n),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset)}}function x(e,t,n,i){for(var o,r,a,s=t;(o=s.parentNode)&&o!==i&&o.nodeType===w&&1===o.childNodes.length;)s=o;N(s),a=e.childNodes.length,r=e.lastChild,r&&"BR"===r.nodeName&&(e.removeChild(r),a-=1),e.appendChild(S(t)),n.setStart(e,a),n.collapse(!0),L(e,n),Y&&(r=e.lastChild)&&"BR"===r.nodeName&&e.removeChild(r)}function A(e,t){var n,i,o=e.previousSibling,r=e.firstChild,a=e.ownerDocument,s="LI"===e.nodeName;if(!s||r&&/^[OU]L$/.test(r.nodeName))if(o&&f(o,e)){if(!d(o)){if(!s)return;i=y(a,"DIV"),i.appendChild(S(o)),o.appendChild(i)}N(e),n=!d(e),o.appendChild(S(e)),n&&E(o,t),r&&A(r,t)}else s&&(o=y(a,"DIV"),e.insertBefore(o,r),T(o,t))}function O(e){this.isShiftDown=e.shiftKey}function B(e,t,n){var i,o;if(e||(e={}),t)for(i in t)!n&&i in e||(o=t[i],e[i]=o&&o.constructor===Object?B(e[i],o,n):o);return e}function R(e,t){e.nodeType===M&&(e=e.body);var n,i=e.ownerDocument,o=i.defaultView;this._win=o,this._doc=i,this._root=e,this._events={},this._isFocused=!1,this._lastSelection=null,oe&&this.addEventListener("beforedeactivate",this.getSelection),this._hasZWS=!1,this._lastAnchorNode=null,this._lastFocusNode=null,this._path="",this._willUpdatePath=!1,"onselectionchange"in i?this.addEventListener("selectionchange",this._updatePathOnEvent):(this.addEventListener("keyup",this._updatePathOnEvent),this.addEventListener("mouseup",this._updatePathOnEvent)),this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0,this._isInUndoState=!1,this._ignoreChange=!1,this._ignoreAllChanges=!1,re?(n=new MutationObserver(this._docWasChanged.bind(this)),n.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._mutation=n):this.addEventListener("keyup",this._keyUpDetectChange),this._restoreSelection=!1,this.addEventListener("blur",D),this.addEventListener("mousedown",U),this.addEventListener("touchstart",U),this.addEventListener("focus",P),this._awaitingPaste=!1,this.addEventListener(V?"beforecut":"cut",Je),this.addEventListener("copy",et),this.addEventListener("keydown",O),this.addEventListener("keyup",O),this.addEventListener(V?"beforepaste":"paste",tt),this.addEventListener("drop",nt),this.addEventListener(Y?"keypress":"keydown",Ue),this._keyHandlers=Object.create(Fe),this.setConfig(t),V&&(o.Text.prototype.splitText=function(e){var t=this.ownerDocument.createTextNode(this.data.slice(e)),n=this.nextSibling,i=this.parentNode,o=this.length-e;return n?i.insertBefore(t,n):i.appendChild(t),o&&this.deleteData(e,o),t}),e.setAttribute("contenteditable","true");try{i.execCommand("enableObjectResizing",!1,"false"),i.execCommand("enableInlineTableEditing",!1,"false")}catch(e){}e.__squire__=this,this.setHTML("")}function D(){this._restoreSelection=!0}function U(){this._restoreSelection=!1}function P(){this._restoreSelection&&this.setSelection(this._lastSelection)}function I(e,t,n){var i,o;for(i=t.firstChild;i;i=o){if(o=i.nextSibling,a(i)){if(i.nodeType===F||"BR"===i.nodeName||"IMG"===i.nodeName){n.appendChild(i);continue}}else if(s(i)){n.appendChild(e.createDefaultBlock([I(e,i,e._doc.createDocumentFragment())]));continue}I(e,i,n)}return n}var w=1,F=3,M=9,H=11,W=1,z="",q=e.defaultView,K=navigator.userAgent,G=/Android/.test(K),Z=/iP(?:ad|hone|od)/.test(K),j=/Mac OS X/.test(K),$=/Windows NT/.test(K),Q=/Gecko\//.test(K),V=/Trident\/[456]\./.test(K),Y=!!q.opera,X=/Edge\//.test(K),J=!X&&/WebKit\//.test(K),ee=/Trident\/[4567]\./.test(K),te=j?"meta-":"ctrl-",ne=V||Y,ie=V||J,oe=V,re="undefined"!=typeof MutationObserver,ae="undefined"!=typeof WeakMap,se=/[^ \t\r\n]/,de=Array.prototype.indexOf;Object.create||(Object.create=function(e){var t=function(){};return t.prototype=e,new t});var le={1:1,2:2,3:4,8:128,9:256,11:1024},ce=function(){return!0};n.prototype.nextNode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){for(e=t.firstChild;!e&&t&&t!==n;)(e=t.nextSibling)||(t=t.parentNode);if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}},n.prototype.previousNode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){if(t===n)return null;if(e=t.previousSibling)for(;t=e.lastChild;)e=t;else e=t.parentNode;if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}},n.prototype.previousPONode=function(){for(var e,t=this.currentNode,n=this.root,i=this.nodeType,o=this.filter;;){for(e=t.lastChild;!e&&t&&t!==n;)(e=t.previousSibling)||(t=t.parentNode);if(!e)return null;if(le[e.nodeType]&i&&o(e))return this.currentNode=e,e;t=e}};var he=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|HR|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,ue={BR:1,HR:1,IFRAME:1,IMG:1,INPUT:1},fe=0,pe=1,ge=2,me=3,ve=ae?new WeakMap:null,_e=function(e,t){for(var n=e.childNodes;t&&e.nodeType===w;)e=n[t-1],n=e.childNodes,t=n.length;return e},Ne=function(e,t){if(e.nodeType===w){var n=e.childNodes;if(t-1,r=e.compareBoundaryPoints(1,i)<1;return!o&&!r}var a=e.compareBoundaryPoints(0,i)<1,s=e.compareBoundaryPoints(2,i)>-1;return a&&s},be=function(e){for(var t,n=e.startContainer,i=e.startOffset,r=e.endContainer,a=e.endOffset,s=!0;n.nodeType!==F&&(t=n.childNodes[i])&&!o(t);)n=t,i=0;if(a)for(;r.nodeType!==F;){if(!(t=r.childNodes[a-1])||o(t)){if(s&&t&&"BR"===t.nodeName){a-=1,s=!1;continue}break}r=t,a=_(r)}else for(;r.nodeType!==F&&(t=r.firstChild)&&!o(t);)r=t;e.collapsed?(e.setStart(r,a),e.setEnd(n,i)):(e.setStart(n,i),e.setEnd(r,a))},ke=function(e,t,n,i){var o,r=e.startContainer,a=e.startOffset,s=e.endContainer,d=e.endOffset,l=!0;for(t||(t=e.commonAncestorContainer),n||(n=t);!a&&r!==t&&r!==i;)o=r.parentNode,a=de.call(o.childNodes,r),r=o;for(;;){if(l&&s.nodeType!==F&&s.childNodes[d]&&"BR"===s.childNodes[d].nodeName&&(d+=1,l=!1),s===n||s===i||d!==_(s))break;o=s.parentNode,d=de.call(o.childNodes,s)+1,s=o}e.setStart(r,a),e.setEnd(s,d)},Le=function(e,t){var n,i=e.startContainer;return a(i)?n=c(i,t):i!==t&&s(i)?n=i:(n=_e(i,e.startOffset),n=h(n,t)),n&&Ee(e,n,!0)?n:null},xe=function(e,t){var n,i,o=e.endContainer;if(a(o))n=c(o,t);else if(o!==t&&s(o))n=o;else{if(!(n=Ne(o,e.endOffset))||!m(t,n))for(n=t;i=n.lastChild;)n=i;n=c(n,t)}return n&&Ee(e,n,!0)?n:null},Ae=new n(null,4|W,function(e){return e.nodeType===F?se.test(e.data):"IMG"===e.nodeName}),Oe=function(e,t){var n,i=e.startContainer,o=e.startOffset;if(Ae.root=null,i.nodeType===F){if(o)return!1;n=i}else if(n=Ne(i,o),n&&!m(t,n)&&(n=null),!n&&(n=_e(i,o),n.nodeType===F&&n.length))return!1;return Ae.currentNode=n,Ae.root=Le(e,t),!Ae.previousNode()},Be=function(e,t){var n,i=e.endContainer,o=e.endOffset;if(Ae.root=null,i.nodeType===F){if((n=i.data.length)&&o-1||!Q&&de.call(o,"text/plain")>-1&&de.call(o,"text/rtf")<0))return e.preventDefault(),void(!d&&(r=a.getData("text/html"))?this.insertHTML(r,!0):((r=a.getData("text/plain"))||(r=a.getData("text/uri-list")))&&this.insertPlainText(r,!0));this._awaitingPaste=!0;var f=this._doc.body,p=this.getSelection(),g=p.startContainer,m=p.startOffset,v=p.endContainer,_=p.endOffset,C=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});f.appendChild(C),p.selectNodeContents(C),this.setSelection(p),setTimeout(function(){try{u._awaitingPaste=!1;for(var e,t,n="",i=C;C=i;)i=C.nextSibling,N(C),e=C.firstChild,e&&e===C.lastChild&&"DIV"===e.nodeName&&(C=e),n+=C.innerHTML;t=u.createRange(g,m,v,_),u.setSelection(t),n&&u.insertHTML(n,!0)}catch(e){u.didError(e)}},0)},nt=function(e){for(var t=e.dataTransfer.types,n=t.length,i=!1,o=!1;n--;)switch(t[n]){case"text/plain":i=!0;break;case"text/html":o=!0;break;default:return}(o||i)&&this.saveUndoState()},it=R.prototype,ot=function(e,t,n){var i=n._doc,o=e?DOMPurify.sanitize(e,{ALLOW_UNKNOWN_PROTOCOLS:!0,WHOLE_DOCUMENT:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0}):null;return o?i.importNode(o,!0):i.createDocumentFragment()};it.setConfig=function(e){return e=B({blockTag:"DIV",blockAttributes:null,tagAttributes:{blockquote:null,ul:null,ol:null,li:null,a:null},classNames:{colour:"colour",fontFamily:"font",fontSize:"size",highlight:"highlight"},leafNodeNames:ue,undo:{documentSizeThreshold:-1,undoLimit:-1},isInsertedHTMLSanitized:!0,isSetHTMLSanitized:!0,sanitizeToDOMFragment:"undefined"!=typeof DOMPurify&&DOMPurify.isSupported?ot:null,willCutCopy:null},e,!0),e.blockTag=e.blockTag.toUpperCase(),this._config=e,this},it.createElement=function(e,t,n){return y(this._doc,e,t,n)},it.createDefaultBlock=function(e){var t=this._config;return T(this.createElement(t.blockTag,t.blockAttributes,e),this._root)},it.didError=function(e){console.log(e)},it.getDocument=function(){return this._doc},it.getRoot=function(){return this._root},it.modifyDocument=function(e){var t=this._mutation;t&&(t.takeRecords().length&&this._docWasChanged(),t.disconnect()),this._ignoreAllChanges=!0,e(),this._ignoreAllChanges=!1,t&&(t.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._ignoreChange=!1)};var rt={pathChange:1,select:1,input:1,undoStateChange:1};it.fireEvent=function(e,t){var n,i,o,r=this._events[e];if(/^(?:focus|blur)/.test(e))if(n=this._root===this._doc.activeElement,"focus"===e){if(!n||this._isFocused)return this;this._isFocused=!0}else{if(n||!this._isFocused)return this;this._isFocused=!1}if(r)for(t||(t={}),t.type!==e&&(t.type=e),r=r.slice(),i=r.length;i--;){o=r[i];try{o.handleEvent?o.handleEvent(t):o.call(this,t)}catch(t){t.details="Squire: fireEvent error. Event type: "+e,this.didError(t)}}return this},it.destroy=function(){var e,t=this._events;for(e in t)this.removeEventListener(e);this._mutation&&this._mutation.disconnect(),delete this._root.__squire__,this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0},it.handleEvent=function(e){this.fireEvent(e.type,e)},it.addEventListener=function(e,t){var n=this._events[e],i=this._root;return t?(n||(n=this._events[e]=[],rt[e]||("selectionchange"===e&&(i=this._doc),i.addEventListener(e,this,!0))),n.push(t),this):(this.didError({name:"Squire: addEventListener with null or undefined fn",message:"Event type: "+e}),this)},it.removeEventListener=function(e,t){var n,i=this._events[e],o=this._root;if(i){if(t)for(n=i.length;n--;)i[n]===t&&i.splice(n,1);else i.length=0;i.length||(delete this._events[e],rt[e]||("selectionchange"===e&&(o=this._doc),o.removeEventListener(e,this,!0)))}return this},it.createRange=function(e,t,n,i){if(e instanceof this._win.Range)return e.cloneRange();var o=this._doc.createRange();return o.setStart(e,t),n?o.setEnd(n,i):o.setEnd(e,t),o},it.getCursorPosition=function(e){if(!e&&!(e=this.getSelection())||!e.getBoundingClientRect)return null;var t,n,i=e.getBoundingClientRect();return i&&!i.top&&(this._ignoreChange=!0,t=this._doc.createElement("SPAN"),t.textContent=z,Ce(e,t),i=t.getBoundingClientRect(),n=t.parentNode,n.removeChild(t),L(n,e)),i},it._moveCursorTo=function(e){var t=this._root,n=this.createRange(t,e?0:t.childNodes.length);return be(n),this.setSelection(n),this},it.moveCursorToStart=function(){return this._moveCursorTo(!0)},it.moveCursorToEnd=function(){return this._moveCursorTo(!1)};var at=function(e){return e._win.getSelection()||null};it.setSelection=function(e){if(e)if(this._lastSelection=e,this._isFocused)if(G&&!this._restoreSelection)D.call(this),this.blur(),this.focus();else{Z&&this._win.focus();var t=at(this);t&&(t.removeAllRanges(),t.addRange(e))}else D.call(this);return this},it.getSelection=function(){var e,t,n,i,r=at(this),a=this._root;return this._isFocused&&r&&r.rangeCount&&(e=r.getRangeAt(0).cloneRange(),t=e.startContainer,n=e.endContainer,t&&o(t)&&e.setStartBefore(t),n&&o(n)&&e.setEndBefore(n)),e&&m(a,e.commonAncestorContainer)?this._lastSelection=e:(e=this._lastSelection,i=e.commonAncestorContainer,m(i.ownerDocument,i)||(e=null)),e||(e=this.createRange(a.firstChild,0)),e},it.getSelectedText=function(){var e=this.getSelection();if(!e||e.collapsed)return"";var t,i=new n(e.commonAncestorContainer,4|W,function(t){return Ee(e,t,!0)}),o=e.startContainer,r=e.endContainer,s=i.currentNode=o,d="",l=!1;for(i.filter(s)||(s=i.nextNode());s;)s.nodeType===F?(t=s.data)&&/\S/.test(t)&&(s===r&&(t=t.slice(0,e.endOffset)),s===o&&(t=t.slice(e.startOffset)),d+=t,l=!0):("BR"===s.nodeName||l&&!a(s))&&(d+="\n",l=!1),s=i.nextNode();return d},it.getPath=function(){return this._path};var st=function(e,t){for(var i,o,r,s=new n(e,4);o=s.nextNode();)for(;(r=o.data.indexOf(z))>-1&&(!t||o.parentNode!==t);){if(1===o.length){do{i=o.parentNode,i.removeChild(o),o=i,s.currentNode=i}while(a(o)&&!_(o));break}o.deleteData(r,1)}};it._didAddZWS=function(){this._hasZWS=!0},it._removeZWS=function(){this._hasZWS&&(st(this._root),this._hasZWS=!1)},it._updatePath=function(e,t){if(e){var n,i=e.startContainer,o=e.endContainer;(t||i!==this._lastAnchorNode||o!==this._lastFocusNode)&&(this._lastAnchorNode=i,this._lastFocusNode=o,n=i&&o?i===o?v(o,this._root,this._config):"(selection)":"",this._path!==n&&(this._path=n,this.fireEvent("pathChange",{path:n}))),this.fireEvent(e.collapsed?"cursor":"select",{range:e})}},it._updatePathOnEvent=function(e){var t=this;t._isFocused&&!t._willUpdatePath&&(t._willUpdatePath=!0,setTimeout(function(){t._willUpdatePath=!1,t._updatePath(t.getSelection())},0))},it.focus=function(){return this._root.focus(),ee&&this.fireEvent("focus"),this},it.blur=function(){return this._root.blur(),ee&&this.fireEvent("blur"),this};var dt="squire-selection-end";it._saveRangeToBookmark=function(e){var t,n=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),i=this.createElement("INPUT",{id:dt,type:"hidden"});Ce(e,n),e.collapse(!1),Ce(e,i),2&n.compareDocumentPosition(i)&&(n.id=dt,i.id="squire-selection-start",t=n,n=i,i=t),e.setStartAfter(n),e.setEndBefore(i)},it._getRangeAndRemoveBookmark=function(e){var t=this._root,n=t.querySelector("#squire-selection-start"),i=t.querySelector("#"+dt);if(n&&i){var o=n.parentNode,r=i.parentNode,a=de.call(o.childNodes,n),s=de.call(r.childNodes,i);o===r&&(s-=1),N(n),N(i),e||(e=this._doc.createRange()),e.setStart(o,a),e.setEnd(r,s),L(o,e),o!==r&&L(r,e),e.collapsed&&(o=e.startContainer,
+o.nodeType===F&&(r=o.childNodes[e.startOffset],r&&r.nodeType===F||(r=o.childNodes[e.startOffset-1]),r&&r.nodeType===F&&(e.setStart(r,0),e.collapse(!0))))}return e||null},it._keyUpDetectChange=function(e){var t=e.keyCode;e.ctrlKey||e.metaKey||e.altKey||!(t<16||t>20)||!(t<33||t>45)||this._docWasChanged()},it._docWasChanged=function(){if(ae&&(ve=new WeakMap),!this._ignoreAllChanges){if(re&&this._ignoreChange)return void(this._ignoreChange=!1);this._isInUndoState&&(this._isInUndoState=!1,this.fireEvent("undoStateChange",{canUndo:!0,canRedo:!1})),this.fireEvent("input")}},it._recordUndoState=function(e,t){if(!this._isInUndoState||t){var n,i=this._undoIndex,o=this._undoStack,r=this._config.undo,a=r.documentSizeThreshold,s=r.undoLimit;t||(i+=1),i-1&&2*n.length>a&&s>-1&&i>s&&(o.splice(0,i-s),i=s,this._undoStackLength=s),o[i]=n,this._undoIndex=i,this._undoStackLength+=1,this._isInUndoState=!0}},it.saveUndoState=function(e){return e===t&&(e=this.getSelection()),this._recordUndoState(e,this._isInUndoState),this._getRangeAndRemoveBookmark(e),this},it.undo=function(){if(0!==this._undoIndex||!this._isInUndoState){this._recordUndoState(this.getSelection(),!1),this._undoIndex-=1,this._setHTML(this._undoStack[this._undoIndex]);var e=this._getRangeAndRemoveBookmark();e&&this.setSelection(e),this._isInUndoState=!0,this.fireEvent("undoStateChange",{canUndo:0!==this._undoIndex,canRedo:!0}),this.fireEvent("input")}return this},it.redo=function(){var e=this._undoIndex,t=this._undoStackLength;if(e+1c&&h.splitText(c),h===s&&l&&(h=h.splitText(l),d===s&&(d=h,c-=l),s=h,l=0),o=this.createElement(e,t),C(h,o),o.appendChild(h))}while(r.nextNode());d.nodeType!==F&&(h.nodeType===F?(d=h,c=h.length):(d=h.parentNode,c=1)),i=this.createRange(s,l,d,c)}return i},it._removeFormat=function(e,t,n,i){this._saveRangeToBookmark(n);var o,r=this._doc;n.collapsed&&(ie?(o=r.createTextNode(z),this._didAddZWS()):o=r.createTextNode(""),Ce(n,o));for(var s=n.commonAncestorContainer;a(s);)s=s.parentNode;var d=n.startContainer,l=n.startOffset,c=n.endContainer,h=n.endOffset,u=[],f=function(e,t){if(!Ee(n,e,!1)){var i,o,r=e.nodeType===F;if(!Ee(n,e,!0))return void("INPUT"===e.nodeName||r&&!e.data||u.push([t,e]));if(r)e===c&&h!==e.length&&u.push([t,e.splitText(h)]),e===d&&l&&(e.splitText(l),u.push([t,e]));else for(i=e.firstChild;i;i=o)o=i.nextSibling,f(i,t)}},g=Array.prototype.filter.call(s.getElementsByTagName(e),function(i){return Ee(n,i,!0)&&p(i,e,t)});return i||g.forEach(function(e){f(e,e)}),u.forEach(function(e){var t=e[0].cloneNode(!1),n=e[1];C(n,t),t.appendChild(n)}),g.forEach(function(e){C(e,S(e))}),this._getRangeAndRemoveBookmark(n),o&&n.collapse(!1),L(s,n),n},it.changeFormat=function(e,t,n,i){return n||(n=this.getSelection())?(this.saveUndoState(n),t&&(n=this._removeFormat(t.tag.toUpperCase(),t.attributes||{},n,i)),e&&(n=this._addFormat(e.tag.toUpperCase(),e.attributes||{},n)),this.setSelection(n),this._updatePath(n,!0),re||this._docWasChanged(),this):this};var lt={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"},ct=function(e,t,n,i){var o=lt[t.nodeName],r=null,a=b(n,i,t.parentNode,e._root),s=e._config;return o||(o=s.blockTag,r=s.blockAttributes),p(a,o,r)||(t=y(a.ownerDocument,o,r),a.dir&&(t.dir=a.dir),C(a,t),t.appendChild(S(a)),a=t),a};it.forEachBlock=function(e,t,n){if(!n&&!(n=this.getSelection()))return this;t&&this.saveUndoState(n);var i=this._root,o=Le(n,i),r=xe(n,i);if(o&&r)do{if(e(o)||o===r)break}while(o=h(o,i));return t&&(this.setSelection(n),this._updatePath(n,!0),re||this._docWasChanged()),this},it.modifyBlocks=function(e,t){if(!t&&!(t=this.getSelection()))return this;this._recordUndoState(t,this._isInUndoState);var n,i=this._root;return Re(t,i),ke(t,i,i,i),n=Se(t,i,i),Ce(t,e.call(this,n)),t.endOffset]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i,Ct=function(e,t,i){for(var o,r,a,s,d,l,c,h=e.ownerDocument,u=new n(e,4,function(e){return!g(e,t,"A")}),f=i._config.tagAttributes.a;o=u.nextNode();)for(r=o.data,a=o.parentNode;s=Nt.exec(r);)d=s.index,l=d+s[0].length,d&&(c=h.createTextNode(r.slice(0,d)),a.insertBefore(c,o)),c=i.createElement("A",B({href:s[1]?/^(?:ht|f)tps?:/i.test(s[1])?s[1]:"http://"+s[1]:"mailto:"+s[0]},f,!1)),c.textContent=r.slice(d,l),a.insertBefore(c,o),o.data=r=r.slice(l)};it.insertHTML=function(e,t){var n,i,o,r,a,s,d,l=this._config,c=l.isInsertedHTMLSanitized?l.sanitizeToDOMFragment:null,u=this.getSelection(),f=this._doc;"function"==typeof c?r=c(e,t,this):(t&&(n=e.indexOf("\x3c!--StartFragment--\x3e"),i=e.lastIndexOf("\x3c!--EndFragment--\x3e"),n>-1&&i>-1&&(e=e.slice(n+20,i))),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e=""+e+"
"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e=""),o=this.createElement("DIV"),o.innerHTML=e,r=f.createDocumentFragment(),r.appendChild(S(o))),this.saveUndoState(u);try{for(a=this._root,s=r,d={fragment:r,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},Ct(r,r,this),je(r,l),Ye(r,a,!1),$e(r),r.normalize();s=h(s,r);)T(s,a);t&&this.fireEvent("willPaste",d),d.defaultPrevented||(Te(u,d.fragment,a),re||this._docWasChanged(),u.collapse(!1),this._ensureBottomLine()),this.setSelection(u),this._updatePath(u,!0),t&&this.focus()}catch(e){this.didError(e)}return this};var St=function(e){return e.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")};it.insertPlainText=function(e,t){var n,i,o,r,a=e.split("\n"),s=this._config,d=s.blockTag,l=s.blockAttributes,c=""+d+">",h="<"+d;for(n in l)h+=" "+n+'="'+St(l[n])+'"';for(h+=">",i=0,o=a.length;i")+c;return this.insertHTML(a.join(""),t)};var yt=function(e,t,n){return function(){return this[e](t,n),this.focus()}};it.addStyles=function(e){if(e){var t=this._doc.documentElement.firstChild,n=this.createElement("STYLE",{type:"text/css"});n.appendChild(this._doc.createTextNode(e)),t.appendChild(n)}return this},it.bold=yt("changeFormat",{tag:"B"}),it.italic=yt("changeFormat",{tag:"I"}),it.underline=yt("changeFormat",{tag:"U"}),it.strikethrough=yt("changeFormat",{tag:"S"}),it.subscript=yt("changeFormat",{tag:"SUB"},{tag:"SUP"}),it.superscript=yt("changeFormat",{tag:"SUP"},{tag:"SUB"}),it.removeBold=yt("changeFormat",null,{tag:"B"}),it.removeItalic=yt("changeFormat",null,{tag:"I"}),it.removeUnderline=yt("changeFormat",null,{tag:"U"}),it.removeStrikethrough=yt("changeFormat",null,{tag:"S"}),it.removeSubscript=yt("changeFormat",null,{tag:"SUB"}),it.removeSuperscript=yt("changeFormat",null,{tag:"SUP"}),it.makeLink=function(e,t){var n=this.getSelection();if(n.collapsed){var i=e.indexOf(":")+1;if(i)for(;"/"===e[i];)i+=1;Ce(n,this._doc.createTextNode(e.slice(i)))}return t=B(B({href:e},t,!0),this._config.tagAttributes.a,!1),this.changeFormat({tag:"A",attributes:t},{tag:"A"},n),this.focus()},it.removeLink=function(){return this.changeFormat(null,{tag:"A"},this.getSelection(),!0),this.focus()},it.setFontFace=function(e){var t=this._config.classNames.fontFamily;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"font-family: "+e+", sans-serif;"}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setFontSize=function(e){var t=this._config.classNames.fontSize;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"font-size: "+("number"==typeof e?e+"px":e)}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setTextColour=function(e){var t=this._config.classNames.colour;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"color:"+e}}:null,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setHighlightColour=function(e){var t=this._config.classNames.highlight;return this.changeFormat(e?{tag:"SPAN",attributes:{class:t,style:"background-color:"+e}}:e,{tag:"SPAN",attributes:{class:t}}),this.focus()},it.setTextAlignment=function(e){return this.forEachBlock(function(t){var n=t.className.split(/\s+/).filter(function(e){return!!e&&!/^align/.test(e)}).join(" ");e?(t.className=n+" align-"+e,t.style.textAlign=e):(t.className=n,t.style.textAlign="")},!0),this.focus()},it.setTextDirection=function(e){return this.forEachBlock(function(t){e?t.dir=e:t.removeAttribute("dir")},!0),this.focus()},it.removeAllFormatting=function(e){if(!e&&!(e=this.getSelection())||e.collapsed)return this;for(var t=this._root,n=e.commonAncestorContainer;n&&!s(n);)n=n.parentNode;if(n||(Re(e,t),n=t),n.nodeType===F)return this;this.saveUndoState(e),ke(e,n,n,t);for(var i,o,r=n.ownerDocument,a=e.startContainer,d=e.startOffset,l=e.endContainer,c=e.endOffset,h=r.createDocumentFragment(),u=r.createDocumentFragment(),f=b(l,c,n,t),p=b(a,d,n,t);p!==f;)i=p.nextSibling,h.appendChild(p),p=i;return I(this,h,u),u.normalize(),p=u.firstChild,i=u.lastChild,o=n.childNodes,p?(n.insertBefore(u,f),d=de.call(o,p),c=de.call(o,i)+1):(d=de.call(o,f),c=d),e.setStart(n,d),e.setEnd(n,c),L(n,e),be(e),this.setSelection(e),this._updatePath(e,!0),this.focus()},it.increaseQuoteLevel=yt("modifyBlocks",ht),it.decreaseQuoteLevel=yt("modifyBlocks",ut),it.makeUnorderedList=yt("modifyBlocks",gt),it.makeOrderedList=yt("modifyBlocks",mt),it.removeList=yt("modifyBlocks",vt),R.isInline=a,R.isBlock=s,R.isContainer=d,R.getBlockWalker=l,R.getPreviousBlock=c,R.getNextBlock=h,R.areAlike=f,R.hasTagAttributes=p,R.getNearest=g,R.isOrContains=m,R.detach=N,R.replaceWith=C,R.empty=S,R.getNodeBefore=_e,R.getNodeAfter=Ne,R.insertNodeInRange=Ce,R.extractContentsOfRange=Se,R.deleteContentsOfRange=ye,R.insertTreeFragmentIntoRange=Te,R.isNodeContainedInRange=Ee,R.moveRangeBoundariesDownTree=be,R.moveRangeBoundariesUpTree=ke,R.getStartBlockOfRange=Le,R.getEndBlockOfRange=xe,R.contentWalker=Ae,R.rangeDoesStartAtBlockBoundary=Oe,R.rangeDoesEndAtBlockBoundary=Be,R.expandRangeToBlockBoundaries=Re,R.onPaste=tt,R.addLinks=Ct,R.splitBlock=ct,R.startSelectionId="squire-selection-start",R.endSelectionId=dt,"object"==typeof exports?module.exports=R:"function"==typeof define&&define.amd?define(function(){return R}):(q.Squire=R,top!==q&&"true"===e.documentElement.getAttribute("data-squireinit")&&(q.editor=new R(e),q.onEditorLoad&&(q.onEditorLoad(q.editor),q.onEditorLoad=null)))}(document);
\ No newline at end of file
diff --git a/source/KeyHandlers.js b/source/KeyHandlers.js
index 4b9b9e1..650f9a9 100644
--- a/source/KeyHandlers.js
+++ b/source/KeyHandlers.js
@@ -169,7 +169,7 @@ var keyHandlers = {
// If this is a malformed bit of document or in a table;
// just play it safe and insert a
.
- if ( !block || /^T[HD]$/.test( block.nodeName ) ) {
+ if ( !block || event.shiftKey || /^T[HD]$/.test( block.nodeName ) ) {
// If inside an , move focus out
parent = getNearest( range.endContainer, root, 'A' );
if ( parent ) {
@@ -251,6 +251,11 @@ var keyHandlers = {
self.setSelection( range );
self._updatePath( range, true );
},
+
+ 'shift-enter': function ( self, event, range ) {
+ return self._keyHandlers.enter( self, event, range );
+ },
+
backspace: function ( self, event, range ) {
var root = self._root;
self._removeZWS();