wooorm / parse-entities

Parse HTML character references
MIT License
49 stars 12 forks source link

[null] Numeric character references must be terminated by a semicolon (alex) #22

Closed sdwheeler closed 1 year ago

sdwheeler commented 2 years ago

I am using Alex with the textlint extension in VS Code. I am getting the following error message:

[null] Numeric character references must be terminated by a semicolon (alex)

Consider the following markdown:

- A ✅ indicates that the version of the OS or PowerShell is still supported
- A ❌ indicates that the version of the OS or PowerShell isn't supported
- A 🟡 indicates the version of PowerShell is no longer supported on that version of the OS
- When both the version of the OS and the version of PowerShell have ✅, that combination is
  supported

|    Alpine     | 7.0 (LTS) |    7.1    | 7.2 (LTS-current) | 7.3 (preview) |
| ------------- | :-------: | :-------: | :---------------: | :-----------: |
| ✅ 3.14 | ❌  | ❌  |     ✅      |   ✅    |
| ✅ 3.13 | ❌  | 🟡 |     ✅      |   ✅    |
| ✅ 3.12 | ✅  | 🟡 |     ✅      |   ✅    |
| ✅ 3.11 | ❌  | 🟡 |     ❌      |   ❌    |
| ❌ 3.10 | 🟡 | 🟡 |     ❌      |   ❌    |
| ❌ 3.9  | 🟡 | 🟡 |     ❌      |   ❌    |

The error is being flagged for all the numeric character references in column 2-5 in the markdown table above. It is not flagging any of the numeric character references in column 1 or in the list items above. If I add any non-space or non-pipe (|) character after the numeric character reference, the error goes away.

Here is a screenshot of the errors in the editor so you can see the line and column references.

image

wooorm commented 2 years ago

I think that error is no longer surfaced for a while now. Can you update alex?

wooorm commented 2 years ago

Also rather weird that it's even warned about. Can you paste the markdown?

sdwheeler commented 2 years ago

The markdown is in my opening comment.

sdwheeler commented 2 years ago

I am using the textlint-rule-alex@3.0.0 rule package with textlint. That is the latest version of that package. It is pinned to use alex 9.1.1.

  "dependencies": {
    "alex": "^9.1.1",
    "textlint-rule-helper": "^2.2.1"
  }
sdwheeler commented 2 years ago

Is there a way to configure Alex to suppress rules I don't want to use, like this parse-entities rule?

wooorm commented 2 years ago

Hmm. It might be easiest to get textlint folks to update alex in their rule, or use alex directly. I don’t know why this issue is happening in some cases, but it’s an intermediate problem in remark-parse, not with this project, and remark-parse has solved this 2 years ago already!

Edit: It could also be a problem with textlint btw, that they pass incorrect text when in tables? I haven’t hear of this in alex or remark itself

wooorm commented 1 year ago

Closing, this hasn’t been an error for ages in alex itself. I defer to intermediate packages.