mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-05-04 23:13:14 +02:00
Add support for count Cyrillic words
Add unicode range for Cyrillic characters
This commit is contained in:
parent
b6b1f7c1ef
commit
bd33cd3c2b
|
@ -1049,7 +1049,7 @@ function extend(target) {
|
|||
|
||||
/* The right word count in respect for CJK. */
|
||||
function wordCount(data) {
|
||||
var pattern = /[a-zA-Z0-9_\u0392-\u03c9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
||||
var pattern = /[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
||||
var m = data.match(pattern);
|
||||
var count = 0;
|
||||
if(m === null) return count;
|
||||
|
@ -2010,4 +2010,4 @@ SimpleMDE.prototype.toTextArea = function() {
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = SimpleMDE;
|
||||
module.exports = SimpleMDE;
|
||||
|
|
Loading…
Reference in a new issue