davidlday / vscode-languagetool-linter

A from scratch redesign of LanguageTool integration for VS Code.
https://marketplace.visualstudio.com/items?itemName=davidlday.languagetool-linter
Apache License 2.0
154 stars 12 forks source link

Spelling is stopped at three ~ #381

Open Hamzelot opened 2 years ago

Hamzelot commented 2 years ago

Describe the bug Hello,

I am currently working with Showoff https://puppetlabs.github.io/showoff/ where there are commands for sectioning

~~~SECTION:handouts~~~
~~~ENDSECTION~~~

etc.

https://puppetlabs.github.io/showoff/documentation/AUTHORING_rdoc.html

Once these sections are defined, the rest of the text is no longer checked for spelling errors.

It seems that as soon as three consecutive ~ are made, the checking stops.

To Reproduce Steps to reproduce the behavior:

  1. open a new .md file
  2. write three consecutive ~ in the first line
  3. write one spelling error in the second line

Expected behavior Spelling should not be interrupted.

Screenshots Not Working: notworking Working: Working Not Working: notworking_2 Working: Working_2

Environment & Configuration (please complete the following information):

davidlday commented 2 years ago

The problem appears to be that the underlying parser I use (remarkjs.org via my other package annotatedtext-remark) adheres to the CommonMark spec, and the way Showoff uses tildes (~) breaks the spec, or at least the parser. The parser I'm using sees three tildas (~) as the beginning of a code fence (https://spec.commonmark.org/0.30/#code-fence). This linter ignores everything in a code fence because it's probably code. In this case, the parser never sees a closing to the code fence because it expects three tildas (~) on a line by themselves, so anything after the perceived start of a code fence is ignored.

You can test this by adding three tildas (~~~) on their own line at line 18 in your first screenshot.

I can see the problem, but I don't see any immediate fix because it stems from the parser. Will need time to think this through.