node-markdown-spellcheck icon indicating copy to clipboard operation
node-markdown-spellcheck copied to clipboard

words in .spelling causing RangeError: Maximum call stack size exceeded

Open macgregor opened this issue 8 years ago • 3 comments

> mdspell --version
1.0.0
> mdspell '**/*.md' '!**/templates/**/*.md' --ignore-numbers --en-us
Spelling - 1-recipes/bread/sourdough_starter.md
/usr/local/lib/node_modules/markdown-spellcheck/es5/spellcheck.js:60
function checkWord(word) {
                  ^

RangeError: Maximum call stack size exceeded
    at Object.checkWord (/usr/local/lib/node_modules/markdown-spellcheck/es5/spellcheck.js:60:19)
    at /usr/local/lib/node_modules/markdown-spellcheck/es5/index.js:59:31
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:3096:16
    at replenish (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:998:17)
    at iterateeCallback (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:983:17)
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:958:16
    at /usr/local/lib/node_modules/markdown-spellcheck/es5/index.js:62:7
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:3096:16
    at replenish (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:998:17)
    at iterateeCallback (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:983:17)
> cat .spelling
# markdown-spellcheck spelling configuration file
# Format - lines beginning # are comments
# global dictionary is at the start, file overrides afterwards
# one word per line, to define a file override use ' - filename'
# where filename is relative to this configuration file
e.g.
Britta
ok
alot
butterbeer
mise
did'nt
prebaked
undercook
Veganomicon
Isa
Moskowitz
maharashtrian
amti
navratan
basmati
poolish
kombucha

The problem word seems to be 'e.g.', if I remove it, the spell checker runs normally. If I try to ignore this word instead of adding it to the dictionary I get:

> mdspell '**/*.md' '!**/templates/**/*.md' --ignore-numbers --en-us
Spelling - 1-recipes/bread/sourdough_starter.md
with a piece of porous cloth (e.g. cheese cloth), you want some
?   Ignore
(node:21572) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RangeError: Maximum call stack size exceeded
(node:21572) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
> mdspell '**/*.md' '!**/templates/**/*.md' --ignore-numbers --en-us
Spelling - 1-recipes/bread/sourdough_starter.md
with a piece of porous cloth (e.g. cheese cloth), you want some
?   Add to file ignores
(node:21654) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RangeError: Maximum call stack size exceeded
(node:21654) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

macgregor avatar Nov 09 '17 17:11 macgregor

I removed "e.g." from my document and .spelling and I am still receiving this error, so it might be a red herring. Think I will have to use a different tool for spell checking.

macgregor avatar Nov 09 '17 18:11 macgregor

I'm getting this same error, but with a different traceback.

If I remove my .spelling file, the error goes away.

$: mdspell 'legacy/**/*.md' --en-us --ignore-acronyms --no-suggestions

Spelling - legacy/application_logic/my_markdown_file.md
/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:919
        return ++i < len ? {value: coll[i], key: i} : null;
                   ^

RangeError: Maximum call stack size exceeded
    at next (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:919:20)
    at replenish (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:989:28)
    at iterateeCallback (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:983:17)
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:958:16
    at /usr/local/lib/node_modules/markdown-spellcheck/es5/index.js:62:7
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:3096:16
    at replenish (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:998:17)
    at iterateeCallback (/usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:983:17)
    at /usr/local/lib/node_modules/markdown-spellcheck/node_modules/async/dist/async.js:958:16
    at /usr/local/lib/node_modules/markdown-spellcheck/es5/index.js:62:7

ialexryan avatar Nov 10 '17 23:11 ialexryan

happy to receive PR's but I won't be actively debugging issues.

lukeapage avatar Nov 12 '17 09:11 lukeapage