mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Ensure removeAllFormatting always returns self.
This commit is contained in:
parent
36432d45bd
commit
8b112b7615
1 changed files with 2 additions and 2 deletions
|
@ -2188,15 +2188,15 @@ var stylingNodeNames = /(^|>)(?:B|I|S|SUB|SUP|U|BLOCKQUOTE|OL|UL|LI|T(?:ABLE|BOD
|
|||
|
||||
proto.removeAllFormatting = function ( range ) {
|
||||
if ( !range && !( range = this.getSelection() ) || range.collapsed ) {
|
||||
return false;
|
||||
return this;
|
||||
}
|
||||
|
||||
var stopNode = range.commonAncestorContainer;
|
||||
while ( stylingNodeNames.test( getPath( stopNode ) ) ) {
|
||||
stopNode = stopNode.parentNode;
|
||||
}
|
||||
return false;
|
||||
if ( stopNode.nodeType === TEXT_NODE ) {
|
||||
return this;
|
||||
}
|
||||
|
||||
moveRangeBoundariesUpTree( range, stopNode );
|
||||
|
|
Loading…
Reference in a new issue