Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown syntax counted as words #55

Open
halcarleton opened this issue Dec 30, 2015 · 7 comments
Open

Markdown syntax counted as words #55

halcarleton opened this issue Dec 30, 2015 · 7 comments

Comments

@halcarleton
Copy link

When using atom-wordcount in a markdown file the markdown syntax is counted as words.

ex.

# This is a Title

This shows a count of 5 words and 17 characters. It should show a count of 4 words and 15 characters.

@OleMchls
Copy link
Owner

OleMchls commented Jan 1, 2016

That is a interesting issue. I'm not sure if this is something which should be handled by this plugin, and if what would be user interface look like? Because technically 4 words and 17 chars is correct. Any thoughts are welcome!

@oychang
Copy link

oychang commented Feb 25, 2016

It might be worth using CSS selectors to only get the printable elements. Or maybe use markdown-preview's renderer to get the text after rendering out the markdown syntax?

I have a variation on OP's complaint: I wish the word count would exclude text in <!-- --> comment blocks. I write some reports in markdown and copy-paste the report requirements as a comment, but it is hard to work towards a word count when the comment is part of the total

@OleMchls
Copy link
Owner

Idea: A regex (initially empty) to match characters / patterns to exclude from the count.

Any implementations / PRs welcome

@alexdevero
Copy link

Regexp applied to .md or .markdown files could work very well for this.

@davidlday
Copy link
Collaborator

@alexdevero - Is this still an issue in the current version? I believe the current version gives 4 words and 16 characters (spaces get included).

@davidlday davidlday assigned davidlday and unassigned davidlday Sep 9, 2018
@ghost
Copy link

ghost commented Jan 14, 2019

Came up with the same result as @davidlday: 4 W | 16 C which is not what OP expects and what the number of characters output by markdown processors (which output 15 characters, including whitespaces).

@davidlday
Copy link
Collaborator

I think #99 will address this.

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

No branches or pull requests

5 participants