Skip to content

Conversation

NicoHood
Copy link

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

@Ionaru
Copy link
Owner

Ionaru commented Feb 20, 2021

Will need some documentation in the README and typings.

@NicoHood
Copy link
Author

NicoHood commented Apr 15, 2021

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 :-)
getgrav/grav#3324

@NicoHood
Copy link
Author

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

@vanillajonathan
Copy link
Contributor

Is this characters with or without the markup?

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

@NicoHood
Copy link
Author

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

@BoPeng
Copy link

BoPeng commented Feb 13, 2023

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

eykd added a commit to eykd/easy-markdown-editor that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants