-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
Description
When linting the following document:
<!DOCTYPE html>
<meta charset="utf-8">
<title>innerHTML to empty string</title>
<link rel="help" href="https://w3c.github.io/DOM-Parsing/#dom-element-innerhtml">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
const doc = document.createElement("html");
doc.innerHTML = "<head><title>foo</title></head><body>";
doc.innerHTML = "";
assert_true(doc.getElementsByTagName("body")[0] instanceof HTMLBodyElement);
}, "Setting innerHTML to empty string");
</script>I get
13:21 error Parsing error: Unterminated string constant
This goes away if I modify line 13 from
doc.innerHTML = "<head><title>foo</title></head><body>";to
doc.innerHTML = "<head><title>foo</title></head>";Setup configuration
- ESLint version: 7.21.0
- eslint-plugin-html version: 6.1.1
- NodeJS version: 15.10.0
- Operating System name and version: Windows 10
- ESLint configuration (.eslintrc): https://github.com/jsdom/jsdom/blob/19df6bc9a52f3018ba555fa51a3f2ac84dc84bd6/.eslintrc.json
Aditional context
This is occuring trying to upgrade jsdom from its current version as of today to the latest versions of ESLint and eslint-plugin-html.
Metadata
Metadata
Assignees
Labels
No labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
BenoitZugmeyer commentedon Mar 7, 2021
Thank you for the report! This looks like an issue with
htmlparser2, so I reported the issue there.build: upgrade htmlparser2
BenoitZugmeyer commentedon Mar 8, 2021
I upgraded htmlparser2, it should be fine now! Let me know how it works for you.
8 remaining items