mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Related https://github.com/the-djmaze/snappymail/issues/28
This commit is contained in:
parent
4946feada3
commit
075762000b
1 changed files with 5 additions and 3 deletions
8
vendors/squire/build/squire-raw.js
vendored
8
vendors/squire/build/squire-raw.js
vendored
|
@ -46,6 +46,8 @@ const
|
|||
|
||||
indexOf = (array, value) => Array.prototype.indexOf.call(array, value),
|
||||
|
||||
filterAccept = NodeFilter.FILTER_ACCEPT,
|
||||
|
||||
typeToBitArray = {
|
||||
// ELEMENT_NODE
|
||||
1: 1,
|
||||
|
@ -108,7 +110,7 @@ const
|
|||
isBlock = node => getNodeCategory( node ) === BLOCK,
|
||||
isContainer = node => getNodeCategory( node ) === CONTAINER,
|
||||
createTreeWalker = (root, whatToShow, filter) => doc.createTreeWalker( root, whatToShow, filter ? {
|
||||
acceptNode: node => filter(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
||||
acceptNode: node => filter(node) ? filterAccept : NodeFilter.FILTER_SKIP
|
||||
} : null
|
||||
),
|
||||
getBlockWalker = ( node, root ) => {
|
||||
|
@ -2732,7 +2734,7 @@ proto.getSelectedText = function () {
|
|||
let addedTextInBlock = false;
|
||||
let value;
|
||||
|
||||
if ( !walker.filter( node ) ) {
|
||||
if ( filterAccept != walker.filter.acceptNode( node ) ) {
|
||||
node = walker.nextNode();
|
||||
}
|
||||
|
||||
|
@ -3220,7 +3222,7 @@ proto._addFormat = function ( tag, attributes, range ) {
|
|||
|
||||
// Make sure we start with a valid node.
|
||||
walker.currentNode = startContainer;
|
||||
if ( !walker.filter( startContainer ) ) {
|
||||
if ( filterAccept != walker.filter.acceptNode( startContainer ) ) {
|
||||
startContainer = walker.nextNode();
|
||||
startOffset = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue