Skip to content

Commit bd33cd3

Browse files
committed
Add support for count Cyrillic words
Add unicode range for Cyrillic characters
1 parent b6b1f7c commit bd33cd3

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;
@@ -2010,4 +2010,4 @@ SimpleMDE.prototype.toTextArea = function() {
20102010
}
20112011
};
20122012

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

0 commit comments

Comments
 (0)