2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-02 07:34:28 -06:00

Merge e1527365d25bb3802568334d4151bc7c527587b5 into 2996b67ec95ec69000ee03ccaee4fcca26cfc701

This commit is contained in:
NicoHood 2025-05-05 06:30:03 +00:00 committed by GitHub
commit 029a6e06de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1801,7 +1801,7 @@ function EasyMDE(options) {
// Handle status bar
if (!Object.prototype.hasOwnProperty.call(options, 'status')) {
options.status = ['autosave', 'lines', 'words', 'cursor'];
options.status = ['autosave', 'lines', 'words', 'characters', 'cursor'];
if (options.uploadImage) {
options.status.unshift('upload-image');
@ -2758,7 +2758,14 @@ EasyMDE.prototype.createStatusbar = function (status) {
} else {
var name = status[i];
if (name === 'words') {
if (name === 'characters') {
defaultValue = function (el) {
el.innerHTML = cm.getValue().length;
};
onUpdate = function (el) {
el.innerHTML = cm.getValue().length;
};
} else if (name === 'words') {
defaultValue = function (el) {
el.innerHTML = wordCount(cm.getValue());
};