Skip to content

Comma occurrence warning is misplaced when backticks involved #994

Description

@henrebotha

Check for existing issues

  • Completed

Environment

  • OS: macOS 15.3.1
  • Install method: Homebrew
  • Vale version: 3.11.2

Describe the bug / provide steps to reproduce it

Reproduction

Style config:

extends: occurrence
message: "More than 2 commas"
scope: sentence
level: suggestion
max: 2
token: ','

Input text:

Test, line.
Line, with, four, commas, `yes`.

Result

The warning attaches to the first line, not the second, but the second line is what actually contains the problem.

Removing the backticks causes the warning to point to the correct place.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions