Gutenberg: wordcount does not count numbers as a word

Created on 21 Oct 2020  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug
As title, the wordcount function does not count plain numbers as a word.

To reproduce
Put something like "Should be 4 words"

Expected behavior
Total words (based on the example) should be 4 words (rather than 3)

Screenshots
no

Editor version (please complete the following information):
I use the npm package of @wordpress/wordcount

Desktop (please complete the following information):

  • OS: Ubuntu (via WSL)
  • Browser Firefox

Additional context
no

Good First Issue Needs Dev [Package] Word count [Type] Enhancement

Most helpful comment

Good point, I tested Microsoft Word, Google Docs and Libre office, all apps count numbers as a word. So I think we should change it in WordPress

All 5 comments

I wouldn't be surprise that's the case. I have done research before raising this, MS Words, and libraries (PHP, JS) I found count numbers as words with no exception. Not that this library has to conform with others but this makes it unusable to most people that are thinking the other way. Will you at least consider an option (or likes) for the alternative behaviour?

Good point, I tested Microsoft Word, Google Docs and Libre office, all apps count numbers as a word. So I think we should change it in WordPress

  • Hi! I am new to open source and would like to take a stab at this issue. Can I work on this?

already tracked at #17988 (specifically https://github.com/WordPress/gutenberg/issues/17988#issuecomment-543066815 ) although that issue is poorly named.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

youknowriad picture youknowriad  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments

jasmussen picture jasmussen  路  3Comments

moorscode picture moorscode  路  3Comments

spocke picture spocke  路  3Comments