Selaa lähdekoodia

Remove redundant checks from remove partial mention post-fixer.

Maciej Gołaszewski 6 vuotta sitten
vanhempi
commit
7a6348a08f
1 muutettua tiedostoa jossa 6 lisäystä ja 9 poistoa
  1. 6 9
      packages/ckeditor5-mention/src/mentionediting.js

+ 6 - 9
packages/ckeditor5-mention/src/mentionediting.js

@@ -156,18 +156,15 @@ function removePartialMentionPostFixer( writer, doc, schema ) {
 
 		if ( change.name == '$text' ) {
 			// Check textNode where the change occurred.
-			if ( change.type == 'insert' || change.type == 'remove' ) {
-				checkAndFix( position.textNode );
+			checkAndFix( position.textNode );
 
-				// Occurs on pasting inside text node with mention;
-				const nodeAfterInsertedTextNode = position.textNode && position.textNode.nextSibling;
-				checkAndFix( nodeAfterInsertedTextNode );
-				checkAndFix( position.nodeBefore );
-			}
+			// Occurs on pasting inside text node with mention;
+			const nodeAfterInsertedTextNode = position.textNode && position.textNode.nextSibling;
+			checkAndFix( nodeAfterInsertedTextNode );
+			checkAndFix( position.nodeBefore );
 
-			// Additional check: when removing text on mention boundaries.
+			// Additional check: when removing text at the beginning of a mention.
 			if ( change.type == 'remove' ) {
-				checkAndFix( position.nodeBefore );
 				checkAndFix( position.nodeAfter );
 			}
 		}