easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Fix #125 Add characters count to status bar

Open NicoHood opened this issue 4 years ago • 6 comments

It turns out to be pretty easy to add a character count. I was quite a bit surprised why this was not yet added, as the css already existed: https://github.com/NicoHood/easy-markdown-editor/blob/master/src/css/easymde.css#L222-L224

NicoHood avatar Feb 18 '21 17:02 NicoHood

Will need some documentation in the README and typings.

Ionaru avatar Feb 20 '21 17:02 Ionaru

I just found out, that the character count is wrong. Html textareas will always send with \r\n, while the javascript only counts \n: https://stackoverflow.com/questions/14217101/what-character-represents-a-new-line-in-a-text-area

Edit: It turns out to make most sense to fix that in the framework, not the javascript. It's been fixed in grav, which I am using. This means this PR is still working properly :-) https://github.com/getgrav/grav/issues/3324

NicoHood avatar Apr 15 '21 09:04 NicoHood

What do you mean by typings? Do I can get that ready.

NicoHood avatar Apr 15 '21 09:04 NicoHood

Is this characters with or without the markup?

The markdown string *Hello* is technically 7 characters, but the human text is 5 characters.

vanillajonathan avatar May 16 '22 12:05 vanillajonathan

I it with markup, so a bit larger than the text itself.

NicoHood avatar May 17 '22 05:05 NicoHood

I am looking for the same feature and would like to see this PR merged.

BoPeng avatar Feb 13 '23 02:02 BoPeng