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

Wrong span reported for HTML with encoded characters #687

Open
1 task done
RobAley opened this issue Sep 21, 2023 · 0 comments
Open
1 task done

Wrong span reported for HTML with encoded characters #687

RobAley opened this issue Sep 21, 2023 · 0 comments

Comments

@RobAley
Copy link

RobAley commented Sep 21, 2023

Check for existing issues

  • Completed

Environment

vale version 2.29.0, Ubuntu 22.04, direct download

Describe the bug / provide steps to reproduce it

Hi,

(Thanks for a very useful tool!)

When linting HTML with encoded entities, the wrong Span is given for errors (apparently using their decoded equivalents).

E.g. For the following HTML :

<p>You know it&rsquo;s great software</p>

Vale reports :

{
  "test.html": [
    {
      "Action": {
        "Name": "",
        "Params": null
      },
      "Span": [
        13,
        16
      ],
      "Check": "write-good.E-Prime",
      "Description": "",
      "Link": "",
      "Message": "Try to avoid using 'it's'.",
      "Severity": "suggestion",
      "Match": "it's",
      "Line": 1
    }
  ]
}

The Span is 13 - 16 (4 characters) corresponding to "it's", rather than 13 - 22 corresponding to "it&rsquo;s" .

I would expect the span to be reported in relation to the input text.

Many thanks.

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

1 participant