8
0
Quellcode durchsuchen

Revert regexp literal to use constructor syntax to prevent error during build.

Mateusz Samsel vor 6 Jahren
Ursprung
Commit
b23f0018e7
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      packages/ckeditor5-word-count/src/wordcount.js

+ 1 - 1
packages/ckeditor5-word-count/src/wordcount.js

@@ -239,7 +239,7 @@ export default class WordCount extends Plugin {
 		// {Pd} - Any kind of hyphen or dash.
 		// {Pc} - A punctuation character such as an underscore that connects words.
 		const wordsMatchRegExp = regExpFeatureDetection.isUnicodePropertySupported ?
-			/[\p{L}\p{N}\p{M}\p{Pd}\p{Pc}]+/gu :
+			new RegExp( '[\\p{L}\\p{N}\\p{M}\\p{Pd}\\p{Pc}]+', 'gu' ) : // Usage of regular expression literal cause error during build
 			/[_\-a-zA-Z0-9À-ž]+/gu;
 
 		const detectedWords = txt.match( wordsMatchRegExp ) || [];