vinta / pangu.js

Paranoid text spacing in JavaScript
https://chrome.google.com/webstore/detail/paphcfdffjnbcgkokihcdjliihicmbpd
MIT License
4.35k stars 295 forks source link

do not remove space after '/' #195

Open ppwwyyxx opened 2 years ago

ppwwyyxx commented 2 years ago

This PR adds a few more test cases - all of them fail before this PR. https://github.com/vinta/pangu.js/issues/194 also talks about these failed cases.

However, after this PR, the existing test case

assert.equal(pangu.spacing('/home/和/root是Linux中的頂級目錄'), '/home/ 和 /root 是 Linux 中的頂級目錄');

will fail.

I think there is no way to make both work, and I think the new test cases are more important & common than the old special test case mentioning linux file system structure like "/home".

Also, when mentioning "/home", writers should better quote them - I modified the test case to add quotes.

Fix #194

ppwwyyxx commented 2 months ago

@vinta Would you take a look?