Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Illegal argument: character must be non-negative (#37)
If the W3C violation occurs in the first character of the file, e.g. if the file references a legacy doctype, message.hiliteStart will be 0, and message.hiliteStart-1 will be negative, causing the error Illegal argument: character must be non-negative. This was a quick fix: instead of passing message.hiliteStart-1 directly as a parameter of vscode.Position, pass Math.max(message.hiliteStart-1,0), which forces the character to be nonnegative.
- Loading branch information