Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work well with Markdown formatting #1355

Open
andrewvaughan opened this issue Aug 19, 2023 · 3 comments
Open

Does not work well with Markdown formatting #1355

andrewvaughan opened this issue Aug 19, 2023 · 3 comments

Comments

@andrewvaughan
Copy link

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

  • typography.symbols.sentence_spacing (which fails any time you have a table formatted by prettier, which is another very common linter for Markdown users)
  • leonard.exclamation.30ppm (as exclamation points are a very common character for markdown files, as they are part of the language standard - e.g., for images)

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

@Nytelife26
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants