HTMLParser should ignore not native HTML attributes
See original GitHub issueAttributes not native to HTML (such in vue or react & attributes with non completly string values) should be ignored by HTMLParser completly instead giving back as classes.
<input :checked="isCheckbox ? value : undefined" />
<div class={isRead ? "red": "green"} />
running with following,
const parser = new HTMLParser(text);
const classes = parser.parseClasses();
will give back the classes
isCheckbox ? value : undefined
isRead ? "red": "green"
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Why was strict parsing not chosen for HTML?
The HTML parser will ignore tags which it does not understand, and will ignore attributes which it does not understand of CERN-SGML tags....
Read more >Strip HTML from strings in Python - Stack Overflow
When printing a line in an HTML file, I'm trying to find a way to only show the contents of each HTML element...
Read more >Parsing HTML: a guide to select the right library
Parsing HTML. The goal of this article is helping you to find the right library to process HTML: we consider Java, C#, Python,...
Read more >HTML 5.2: 8. The HTML syntax - W3C
Attribute names must consist of one or more characters other than the space characters, U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027 ...
Read more >htmlparser2 - npm
htmlparser2 is the fastest HTML parser, and takes some shortcuts to ... Closing tags without corresponding * opening tags will be ignored.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
const parser = new HTMLParser(text);
Yes, that’s exactly what I mean 😛. We can have a block list and add more as we go.