You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi! i think i've found a bug. when using a negative lookbehind in a substitution rule, the position is reported incorrectly if there are two occurrences on the same line. this is the rule i'm using
swap:
'(?<!IP )address': discuss
and the file i'm using
# test
this is an IP address: 192.168.0.1. we should address this
expected:
error should be found at 3:47
actual:
error is reported at 3:15
this isn't an issue when the two occurrences of "address" are on different lines. this file
# test
this is an IP address: 192.168.0.1.
we should address this
Check for existing issues
Environment
macOS
Homebrew
vale version 2.30.0
Describe the bug / provide steps to reproduce it
hi! i think i've found a bug. when using a negative lookbehind in a substitution rule, the position is reported incorrectly if there are two occurrences on the same line. this is the rule i'm using
and the file i'm using
expected:
actual:
this isn't an issue when the two occurrences of "address" are on different lines. this file
correctly reports the error at 4:11
reproduction
repo: https://github.com/sunnyzanchi/vale-negative-lookbehind-bug
clone the repo and run
cat *.md && vale *.md
The text was updated successfully, but these errors were encountered: