davidlday/vscode-languagetool-linter

Spelling is stopped at three ~

Hamzelot opened this issue · 1 comments

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):

  • OS + Version: Debian GNU/Linux 11 (bullseye) 5.10.0-9-amd64
  • VS Code Version: 1.63.0
  • LanguageTool Linter Version: 0.19.0
  • Service Configuration: external

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.