amperser / proselint

A linter for prose.
http://proselint.com
BSD 3-Clause "New" or "Revised" License
4.34k stars 178 forks source link

Does not work well with Markdown formatting #1355

Open andrewvaughan opened 1 year ago

andrewvaughan commented 1 year ago

Markdown is almost impossible to check with proselint because of (at least) the following two checks:

There may be more, these are what I've run into thus far.

Nytelife26 commented 1 year ago

The general idea is to find a way to make proselint ignore things other than text segments of files, but we're not quite there yet, since that would require a parser.

I am on holiday right now, but will be happy to discuss further when I return.

andrewvaughan commented 1 year ago

The general idea is to find a way to make proselint ignore things other than text segments of files, but we're not quite there yet, since that would require a parser.

I am on holiday right now, but will be happy to discuss further when I return.

Thanks! An interim idea might be to render any markdown found to HTML and run proselint on the rendered file. That way you don't need to worry about creating another parser by "normalizing" around HTML parsing. Since most documentation formats generally have some way of rendering into HTML as a standard, this may simplify the problem for you across many different documentation formats.

Nytelife26 commented 5 months ago

Thanks! An interim idea might be to render any markdown found to HTML and run proselint on the rendered file.

While this is an interesting idea, it would be slow, and take some effort. In general, the best solution would be to have another tool pass exclusively text segments of files to proselint somehow. The linting ecosystem would be better off if one parser interpreted the files to begin with and distributed relevant sections to each linter accordingly, I believe. However, in terms of what we can do, I do not see a fix for this happening in the near future unfortunately.