atom-wordcount
atom-wordcount copied to clipboard
Markdown syntax counted as words
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.
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!
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
Idea: A regex (initially empty) to match characters / patterns to exclude from the count.
Any implementations / PRs welcome
Regexp applied to .md or .markdown files could work very well for this.
@alexdevero - Is this still an issue in the current version? I believe the current version gives 4 words and 16 characters (spaces get included).
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).
I think #99 will address this.