errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.3k stars 144 forks source link

Inconsistent result depending on random/small variation in a Markdown file #847

Open ccoVeille opened 1 month ago

ccoVeille commented 1 month ago

Check for existing issues

Environment

Linux Homebrew vale 3.4.2

Describe the bug / provide steps to reproduce it

I'm testing a rule to detect GitHub case and suggest fixing it

Here is the rule

---
extends: substitution
message: Use '%s' instead of '%s'
level: warning
ignorecase: true
swap:
  GitHub: GitHub

Here is a test file:

github_test2.md

http://github.com bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/
http://github.com

whatever

Code reports

github_test3.md

http://github.com bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/

http://github.com

The only difference is on last line whatever was replaced by http://github.com

Code reports differs:

Now let's change slightly

bar

[github](#whatever)
[github1](#whatever)
[github.](#whatever)

https://jwodder.github.io/

http://github.com

So the on first line github.com was removed

Code reports differs again and seems normal:

ccoVeille commented 1 month ago

Here are the files

github_test2.md github_test3.md github_test4.md GitHub.yml