mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-02 23:54:28 -06:00
Merge pull request #351 from amka/patch-2
Add support for count Cyrillic words
This commit is contained in:
commit
51ef0cd81d
@ -1049,7 +1049,7 @@ function extend(target) {
|
|||||||
|
|
||||||
/* The right word count in respect for CJK. */
|
/* The right word count in respect for CJK. */
|
||||||
function wordCount(data) {
|
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 m = data.match(pattern);
|
||||||
var count = 0;
|
var count = 0;
|
||||||
if(m === null) return count;
|
if(m === null) return count;
|
||||||
@ -2011,4 +2011,4 @@ SimpleMDE.prototype.toTextArea = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user