瀏覽代碼

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

Mateusz Samsel 6 年之前
父節點
當前提交
b23f0018e7
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 ) || [];