retextjs / retext-spell

plugin to check spelling
https://unifiedjs.com
MIT License
71 stars 16 forks source link

Remove ending punctuation from WordNodes #4

Closed localjo closed 8 years ago

localjo commented 8 years ago

This is a potential workaround for https://github.com/wooorm/nlcst/issues/4 but I'm almost sure that this solution is incorrect.

codecov-io commented 8 years ago

Current coverage is 99.11% (diff: 80.00%)

Merging #4 into master will decrease coverage by 0.88%

@@           master         #4   diff @@
========================================
  Files           2          2          
  Lines         111        113     +2   
  Methods         0          0          
  Messages        0          0          
  Branches        0          0          
========================================
+ Hits          111        112     +1   
- Misses          0          1     +1   
  Partials        0          0          

Powered by Codecov. Last update 6fd6492...5a1be40

wooorm commented 8 years ago

I don’t really think that this temporary problem should be fixed, temporarily, in this project.

Especially like this, as it could break other plugins, and does break words like e.g. and abbreviations ending in a dot mr..

Having it in quality-docs until a real fix is out is better, I feel. Is that OK, for now?

localjo commented 8 years ago

I'm not exactly sure where to put a fix like this in quality-docs. I guess I could add some kind of plugin for retext with workarounds that filter the tree. :-/

wooorm commented 8 years ago

Yeah, like that instead!

retext().use(function () {
  return function (node) {
    visit(node, 'WordNode', function () {
      if (/*...*/) { /*...*/ }
    });
  };
})
localjo commented 8 years ago

Cool. Doing this in quality-docs for now. https://github.com/SparkartGroupInc/quality-docs/commit/30b1e7cb31b57fac84814f5822a3ceb86eacf5cd