Comments (9)
I attempted this, but cheerio is acting strange. I need to call $.root()
to make it work and the syntax highlighted demos ended up busted.
https://github.com/jquery/jqueryui.com/compare/cheerio
from jqueryui.com.
No clue what's going on. Not helping that docs for node-htmlparser options are supposed to be here, but there is no page there: https://github.com/FB55/node-htmlparser/wiki/DOMHandler
from jqueryui.com.
I spend some time with this. I still don't know what cheerio is doing, but I was unable to reproduce the problem in a standalone script, that was doing pretty much the same thing.
One thing I found is this: When doing cheerio.load
with just the syntaxhighlight wrapper pre and code, console.logging should look like this:
{ '0':
{ type: 'tag',
name: 'code',
attribs: { 'data-linenum': 'true' },
parent:
{ type: 'tag',
name: 'pre',
children: [Object],
attribs: {},
parent: [Object],
prev: null,
next: null },
prev: null,
next: null,
children: [] },
length: 1 }
Inside build-demos, I get this instead:
{ '0': 'code', length: 1, _root: [Circular] }
The code to create the elements for that output are pretty much the same, the result is very different. In the second case, manipulation methods fail with weird exceptions.
from jqueryui.com.
Grunt is to blame, it works fine outside grunt. Likely culprit: colors module, as that modifies String.prototype
. Hard to verify, as a ton of modules depend on grunt, loading colors everywhere...
from jqueryui.com.
Tried running a local grunt without loading any plugins, kicking out the require('colors')
, doesn't help. Can't tell what exactly screws up cheerio.
from jqueryui.com.
Well, at least this gives us something to run with. I'm sure we can track it down from here.
from jqueryui.com.
Let me know what you figure out.
from jqueryui.com.
I had the same problem, and have tracked it down to
grunt/node_modules/jshint/packages/jshint/jshint.js - line 842
Removing the block below gets Cheerio working properly for me in Grunt again.
I"ll investigate a longer-term solution.
if (typeof String.prototype.name !== 'function') {
String.prototype.name = function () {
// If the string looks like an identifier, then we can return it as is.
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can simply slap some quotes around it.
// Otherwise we must also replace the offending characters with safe
// sequences.
if (ix.test(this)) {
return this;
}
if (nx.test(this)) {
return '"' + this.replace(nxg, function (a) {
var c = escapes[a];
if (c) {
return c;
}
return '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4);
}) + '"';
}
return '"' + this + '"';
};
}
from jqueryui.com.
Ahh super, upgraded to grunt 3.1.17 which uses a version of JSHint that doesn't tamper with native objects.
from jqueryui.com.
Related Issues (20)
- useless plugin ui resizable HOT 1
- how can i add bootstrap class col-md-offset when i resize jquery ui rresizable from left HOT 2
- Jquery UI issue in autocomplete HOT 1
- jQuery UI Position issue with hidden elements HOT 2
- jQuery CDN - Bug Bounty - Vulnerabilities WebApplicationAssessment HOT 1
- Fix broken links HOT 1
- Comboxbox focus HOT 1
- tabs.js ajax issue HOT 1
- ID vs. Class in Accordeon API-Doc
- [www][forum] jquery forum redricted do blank page after login. HOT 3
- Nuget individual packages are very old HOT 1
- 502 Bad gateway on trying to load upgrade-guide pages HOT 4
- download.jqueryui.com throwing errors HOT 2
- draggable not dragging on touch (iPhone)
- Those IE version checks at the start of the HTML seem to be invalid... HOT 1
- broken link to book HOT 1
- jQuery UI Builder won't download v1.12.1 - it assumes v1.13.0 HOT 2
- confusing grid example in sortable interaction
- [BUG] documentation: demo on autocomplete fails for remote source HOT 3
- jQuery UI Css Link incorrect in the view source example code HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jqueryui.com.