SyntaxError: unmatched pseudo-class :foo
See original GitHub issueTrying to use cheerio to match against a custom HTML node receives that error.
Here is a simple test to try it out:
var cheerio = require('cheerio');
var markup = '<html><body><esi:foo attr="test"></esi:foo></body></html>';
var $ = cheerio.load(markup);
$('esi:foo').text();
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How to fix 'Error: unmatched pseudo-class :flex' in cheerio
I'm using node.js and cheerio. When trying to find an element inside a selector I get the error 'unmatched pseudo-class :flex'
Read more >Selectors - ESLint - Pluggable JavaScript Linter
If the class/attribute/pseudo-class count is tied, the selector that contains more node type selectors has higher specificity. If multiple selectors have equal ...
Read more >CSS Syntax Module Level 3 - W3C
Abstract. This module describes, in general terms, the basic structure and syntax of CSS stylesheets. It defines, in detail, the syntax and ...
Read more >HTML Standard
An understanding of Web IDL, HTTP, XML, Unicode, character encodings, JavaScript, and CSS will also be helpful in places but is not essential....
Read more >JSOC/base/export/webapps/js/jquery-2.1.0.js - view - 1.1
[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters ... the array for every element, matched or not if ( seed ) { unmatched.push(...
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 FreeTop 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
Top GitHub Comments
@fb55 double backslash fixed it. I originally tried one but not two, smh.
Try escaping the colon with a backslash (which needs to be escaped itself with an additional backslash inside JS strings). Otherwise, it is parsed as a pseudo selector.