Skip to content

Spelling error line numbers are incorrect when using HTML entities (or maybe Markdown tables?) #102

@austenstone

Description

@austenstone

The line numbers are incorrect when using HTML entitys such as  .

test.md

| github‑token | Token to use to authorize. | ${{ github.token }} |
| file‑json | JSON file containing the list of files to check. | ${{ file-json }} |
| files‑changed | List of files to check. | ${{ files-changed }} |
spellchecker test.md --reports test.json
test.json
[
    {
        "data": {},
        "messages": [
            {
                "message": "`github‑token` is misspelt",
                "name": "test.md:1:3-1:15",
                "reason": "`github‑token` is misspelt",
                "line": 1,
                "column": 3,
                "location": {
                    "start": {
                        "line": 1,
                        "column": 3,
                        "offset": 2
                    },
                    "end": {
                        "line": 1,
                        "column": 15,
                        "offset": 14
                    }
                },
                "source": "retext-spell",
                "ruleId": "github-token",
                "file": "test.md",
                "fatal": false,
                "actual": "github‑token",
                "expected": [],
                "url": "https://github.com/retextjs/retext-spell#readme"
            },
            {
                "message": "`file‑json` is misspelt",
                "name": "test.md:1:72-1:81",
                "reason": "`file‑json` is misspelt",
                "line": 1,
                "column": 72,
                "location": {
                    "start": {
                        "line": 1,
                        "column": 72,
                        "offset": 71
                    },
                    "end": {
                        "line": 1,
                        "column": 81,
                        "offset": 80
                    }
                },
                "source": "retext-spell",
                "ruleId": "file-json",
                "file": "test.md",
                "fatal": false,
                "actual": "file‑json",
                "expected": [],
                "url": "https://github.com/retextjs/retext-spell#readme"
            },
            {
                "message": "`JSON` is misspelt; did you mean `JASON`, `JON`, `SON`?",
                "name": "test.md:1:84-2:2",
                "reason": "`JSON` is misspelt; did you mean `JASON`, `JON`, `SON`?",
                "line": 1,
                "column": 84,
                "location": {
                    "start": {
                        "line": 1,
                        "column": 84,
                        "offset": 83
                    },
                    "end": {
                        "line": 2,
                        "column": 2,
                        "offset": 87
                    }
                },
                "source": "retext-spell",
                "ruleId": "json",
                "file": "test.md",
                "fatal": false,
                "actual": "JSON",
                "expected": [
                    "JASON",
                    "JON",
                    "SON"
                ],
                "url": "https://github.com/retextjs/retext-spell#readme"
            },
            {
                "message": "`file-json` is misspelt",
                "name": "test.md:2:53-2:62",
                "reason": "`file-json` is misspelt",
                "line": 2,
                "column": 53,
                "location": {
                    "start": {
                        "line": 2,
                        "column": 53,
                        "offset": 138
                    },
                    "end": {
                        "line": 2,
                        "column": 62,
                        "offset": 147
                    }
                },
                "source": "retext-spell",
                "ruleId": "file-json",
                "file": "test.md",
                "fatal": false,
                "actual": "file-json",
                "expected": [],
                "url": "https://github.com/retextjs/retext-spell#readme"
            }
        ],
        "history": [
            "test.md"
        ],
        "cwd": "C:\\Users\\auste\\source\\spellchecker-cli-action-summary",
        "contents": "| github‑token | Token to use to authorize. | ${{ github.token }} |\r\n| file‑json | JSON file containing the list of files to check. | ${{ file-json }} |\r\n| files‑changed | List of files to check. | ${{ files-changed }} |",
        "value": "| github‑token | Token to use to authorize. | ${{ github.token }} |\r\n| file‑json | JSON file containing the list of files to check. | ${{ file-json }} |\r\n| files‑changed | List of files to check. | ${{ files-changed }} |\n"
    }
]
Result Word Line Start Line End Line Start Expected Line End Expected
github‑token 1 1 1 1
file‑json 1 1 2 2
JSON 1 2 2 2
file-json 2 2 2 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions