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

Comments in markdown trigger erroneous spelling error #882

Open
1 task done
rbdixon opened this issue Aug 7, 2024 · 1 comment
Open
1 task done

Comments in markdown trigger erroneous spelling error #882

rbdixon opened this issue Aug 7, 2024 · 1 comment

Comments

@rbdixon
Copy link

rbdixon commented Aug 7, 2024

Check for existing issues

  • Completed

Environment

Reproducible on:

  • MacOS, installed via homebrew, vale version 3.6.1
  • MacOS, GitHub binary, vale version 3.7.0

Describe the bug / provide steps to reproduce it

With the default config:

MinAlertLevel = suggestion

[*]
BasedOnStyles = Vale

This test document:

on <!-- TODO --> a 
sonata

Triggers a spelling error:

$ ./vale test.md 

 test.md
 2:2  error  Did you really mean 'ona'?  Vale.Spelling 

✖ 1 error, 0 warnings and 0 suggestions in 1 file.

My expectation was no errors would be reported.

Remove the comment in the test document and no errors are reported.

The pattern seems to be that the non-comment characters on the first line, in this case on and a, will be flagged as a spelling error on their first usage after the comment. If you break the HTML comment, like this < !-- TODO -->, the unexpected behavior does not occur.

Another failing example is:

on <span/> a 
sonata

By setting BlockIgnores = (?s) (<!--.*?-->)|(<[^>]+\/>) will workaround this issue. This does not, however, explain the unusual behavior where a portion of a valid word is flagged as a spelling error based on the preceding line.

@ccoVeille
Copy link
Contributor

Good catch. Wonderful workaround

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

No branches or pull requests

2 participants