question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: unmatched pseudo-class :foo

See original GitHub issue

@MatthewMueller

Trying 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:closed
  • Created 8 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
redonkuluscommented, Apr 7, 2015

@fb55 double backslash fixed it. I originally tried one but not two, smh.

5reactions
fb55commented, Apr 7, 2015

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found