diff --git a/build/tasks/debug.js b/build/tasks/debug.js index 7217a35..d407ee4 100644 --- a/build/tasks/debug.js +++ b/build/tasks/debug.js @@ -19,26 +19,27 @@ module.exports = function (grunt) { }; var current = root; var parents = []; - var parser = new parse5.SimpleApiParser({ - startTag: function (tagName, attrs) { - var node = { - name: attrs[0].value, - children: [] - }; - parents.push(current); - current.children.push(node); - current = node; - }, - - endTag: function () { - current = parents.pop(); - }, - - text: function (text) { - current.children.push(text); - } + var parser = new parse5.SAXParser(); + + parser.on('startTag', function (tagName, attrs) { + var node = { + name: attrs[0].value, + children: [] + }; + parents.push(current); + current.children.push(node); + current = node; + }); + + parser.on('endTag', function () { + current = parents.pop(); }); - parser.parse(hljs.highlightAuto(example.code, [example.language]).value); + + parser.on('text', function (text) { + current.children.push(text); + }); + + parser.end(hljs.highlightAuto(example.code, [example.language]).value); example.code = root; }); } diff --git a/lib/blocks/jsdebug.js b/lib/blocks/jsdebug.js index 156f276..f09a693 100644 --- a/lib/blocks/jsdebug.js +++ b/lib/blocks/jsdebug.js @@ -801,6 +801,9 @@ var highlightjs = { 'hljs-title': { color: '#5cd94d' }, + 'hljs-name': { + color: '#5cd94d' + }, 'hljs-expression': { color: '#7b521e' }, diff --git a/package.json b/package.json index 0c5e7a7..9c7bff6 100644 --- a/package.json +++ b/package.json @@ -12,26 +12,27 @@ "test": "grunt test:firefox" }, "devDependencies": { - "blocks": "^0.1.4", + "blocks": "^0.3.4", "escodegen": "^1.6.1", - "esprima": "^2.3.0", + "esprima": "^3.0.0", "estraverse": "^4.1.0", - "grunt": "^0.4.5", - "grunt-contrib-jshint": "^0.11.0", - "grunt-contrib-requirejs": "^0.4.4", - "grunt-contrib-uglify": "^0.8.0", - "grunt-contrib-watch": "^0.6.1", - "grunt-karma": "^0.10.1", + "grunt": "^1.0.1", + "grunt-cli": "^1.2.0", + "grunt-contrib-jshint": "^1.0.0", + "grunt-contrib-requirejs": "^1.0.0", + "grunt-contrib-uglify": "^2.0.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-karma": "^2.0.0", "grunt-notify": "^0.4.1", - "grunt-preprocess": "^4.1.0", - "highlight.js": "^8.6.0", + "grunt-preprocess": "^5.1.0", + "highlight.js": "^9.6.0", "jasmine-core": "^2.2.0", - "karma": "^0.12.31", - "karma-chrome-launcher": "^0.1.7", - "karma-firefox-launcher": "^0.1.4", - "karma-ie-launcher": "^0.1.5", - "karma-jasmine": "^0.3.5", + "karma": "^1.2.0", + "karma-chrome-launcher": "^2.0.0", + "karma-firefox-launcher": "^1.0.0", + "karma-ie-launcher": "^1.0.0", + "karma-jasmine": "^1.0.2", "karma-jasmine-jquery": "^0.1.1", - "parse5": "^1.4.1" + "parse5": "^2.2.1" } } diff --git a/src/.jshintrc b/src/.jshintrc index 9173efb..dba7747 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -11,7 +11,7 @@ "curly": true, "freeze": true, "immed": true, - "latedef": true, + "latedef": false, "noarg": true, "noempty": true, "nonbsp": true,