easy-markdown-editor
easy-markdown-editor copied to clipboard
Fix #125 Add characters count to status bar
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
Will need some documentation in the README and typings.
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
What do you mean by typings? Do I can get that ready.
Is this characters with or without the markup?
The markdown string *Hello* is technically 7 characters, but the human text is 5 characters.
I it with markup, so a bit larger than the text itself.
I am looking for the same feature and would like to see this PR merged.