Skip to content

Fix #125 Add characters count to status bar#304

Open
NicoHood wants to merge 1 commit into
Ionaru:masterfrom
NicoHood:characters_count
Open

Fix #125 Add characters count to status bar#304
NicoHood wants to merge 1 commit into
Ionaru:masterfrom
NicoHood:characters_count

Conversation

@NicoHood

Copy link
Copy Markdown

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

Ionaru commented Feb 20, 2021

Copy link
Copy Markdown
Owner

Will need some documentation in the README and typings.

@NicoHood

NicoHood commented Apr 15, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
Author

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

@vanillajonathan

Copy link
Copy Markdown
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
Copy Markdown
Author

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

@BoPeng

BoPeng commented Feb 13, 2023

Copy link
Copy Markdown

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