8
0
Просмотр исходного кода

Other: Get transformation from the match if it occurs and pass it to the event data object

panr 6 лет назад
Родитель
Сommit
22d52e0739
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      packages/ckeditor5-typing/src/textwatcher.js

+ 4 - 1
packages/ckeditor5-typing/src/textwatcher.js

@@ -133,7 +133,10 @@ export default class TextWatcher {
 		this.hasMatch = textHasMatch;
 
 		if ( textHasMatch ) {
-			const eventData = Object.assign( data, { text, range } );
+			// If text matches, get the transformation from the match and then pass it to the
+			// event data object.
+			const transformation = textHasMatch.transformation;
+			const eventData = Object.assign( data, { transformation, text, range } );
 
 			/**
 			 * Fired whenever the text watcher found a match for data changes.