Skip to content

Commit 51ef0cd

Browse files
committed
Merge pull request sparksuite#351 from amka/patch-2
Add support for count Cyrillic words
2 parents 97154e2 + bd33cd3 commit 51ef0cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/simplemde.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ function extend(target) {
10491049

10501050
/* The right word count in respect for CJK. */
10511051
function wordCount(data) {
1052-
var pattern = /[a-zA-Z0-9_\u0392-\u03c9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
1052+
var pattern = /[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
10531053
var m = data.match(pattern);
10541054
var count = 0;
10551055
if(m === null) return count;
@@ -2011,4 +2011,4 @@ SimpleMDE.prototype.toTextArea = function() {
20112011
}
20122012
};
20132013

2014-
module.exports = SimpleMDE;
2014+
module.exports = SimpleMDE;

0 commit comments

Comments
 (0)