IMO the issue here is that: everything that is not carefully specified as a precise algorithm, <i>will</i> be implemented differently.<p>This is why each browser used to parse HTML differently.<p>This is why you'd have compat or even security issues because some software used \r\n for newlines splitting while other used \n.<p>Luckily the browser vendors formed WHATWG which created pretty precise specs which are maybe convoluted but at least everyone parses HTML in the same way, and each browser pretends to be every other browser for compatibility.<p>2021 is really great for web compat, maybe not all browsers implement every API, but existing APIs are accompanied by very thorough test suites (Web Platform Tests):
<a href="https://github.com/web-platform-tests/wpt" rel="nofollow">https://github.com/web-platform-tests/wpt</a><p>Live results from nightly builds: <a href="https://wpt.fyi/results/?label=experimental&label=master&aligned" rel="nofollow">https://wpt.fyi/results/?label=experimental&label=master&ali...</a><p>Having said that I don't see vendors aligning on definition on word count any soon due to corporate inertia, lack of incentives and lack of "Word editors consortium" (or is there any?)<p>A truly good function for word count might be pretty complex, and perhaps different for every language.