-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
TypeError in HTML parser when parsing a custom element followed by a prototype #15511
Copy link
Copy link
Closed
Copy link
Labels
lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 3.0.3
Playground link
# Options (if any):Input:
<constructor>prototpyeoOutput:
TypeError: u(A).getContentType is not a function. (In 'u(A).getContentType()', 'u(A).getContentType' is undefined)
o@https://prettier.io/lib/plugins/html.js:17:16572
_consumeTagOpen@https://prettier.io/lib/plugins/html.js:17:6729
tokenize@https://prettier.io/lib/plugins/html.js:17:511
As@https://prettier.io/lib/plugins/html.js:16:27954
parse@https://prettier.io/lib/plugins/html.js:17:16590
ks@https://prettier.io/lib/plugins/html.js:19:14585
Bs@https://prettier.io/lib/plugins/html.js:19:17013
@https://prettier.io/lib/standalone.js:25:13319Expected behavior:
The parser either throws an expected error "invalid HTML", or it reasonably parses the input without error.
Discovered via https://github.com/jasikpark/fuzz-prettier, my messy attempt at fuzzing prettier and its plugin formatters, hope this is helpful 👍
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.