Closed Zamiell closed 2 years ago
Can you paste a small repro of which versions and which tools
Sure, I tried to create a reprex here, but I get a weird error:
$ npx remark --quiet --frail test.md
test.md
1:1 error Error: mdast-util-to-nlcst expected parser
Any idea what that means?
You are not configuring plugins correctly. See the docs in the remark-retext
readme:
This given processor must have a parser attached (this can be done by using the plugin retext-english or similar) and should use other retext plugins — https://github.com/remarkjs/remark-retext#destination
Ya we are getting the same error. You can see it here in a merge request that displays retext issues using remark lint: https://github.com/CivicActions/handbook/pull/907/files#diff-6c8d09c8d8c36b9ed6e328e38baa799da19cb956b269cf68fbbb404d999d207f
The error specifically is:
Expected `1` space between sentences, not `23` space retext-sentence-spacing
Markdown does not have tables.
Tables are a part of GFM.
Like with any extension to markdown, you need to enable it. These reproductions don’t.
To enable GFM, use remark-gfm
.
The current output, without remark-gfm
, makes sense. You do have 23 spaces between one sentence and another.
Yup that does resolve the error. I updated the bug example to confirm it here https://github.com/dmundra/retext-bug.
Sorry it took me a while to report this simple solution. I thought it was going to be a hairy bug so I tabled it until I had a bunch of free time!
Initial checklist
Affected packages and versions
5.2.0
Steps to reproduce
I forgot my markdown files with Prettier, and then use remark afterwards to validate certain things.
However, this rule does not seem to work properly with markdown tables. For example, it generates false positives for the following text:
Runtime
Node v16
Package manager
yarn 1
OS
Windows
Build and bundle tools
No response