mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-26 11:27:10 -06:00
Microsoft Word treats generated numbered-list labels as independent words in document word statistics, while omitting them from character counts. Previously, word counting in WordCraft inspected plain run text only, causing sample_document() to report 357 words instead of Word's 361. - Add Document::story_word_count and story_word_count_of to compute words directly, including generated numbered labels while skipping bullet markers and empty labels. - Handle LevelSuffix::Nothing correctly by counting labels as independent words without string concatenation artifacts. - Keep Document::plain_text unadorned to maintain exact run text across docbin, clipboard, and tests. - In review.wordCount, report words via story_word_count while preserving character counts from plain_text. - Add regression tests covering numbered lists, bullets, LevelSuffix::Nothing, and review.wordCount word vs character parity. Fixes #893 Co-authored-by: Brandon Thomas <echelon@gmail.com>