Merge pull request #224 from MatheusCamelucci/fix/dependencies

Fix code bugs and update dependencies
This commit is contained in:
Kam Low 2021-08-10 01:54:18 +02:00 committed by GitHub
commit 3257da500b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8659 additions and 1941 deletions

View File

@ -26,10 +26,10 @@ var common = {
var html = marked(value) var html = marked(value)
// We strip the surrounding <p>-tag, if // We strip the surrounding <p>-tag, if
if (stripParagraph) { if (stripParagraph) {
var $ = cheerio("<root>" + html + "</root>") var $ = cheerio.load("<root>" + html + "</root>")
// Only strip <p>-tags and only if there is just one of them. // Only strip <p>-tags and only if there is just one of them.
if ($.children().length === 1 && $.children('p').length === 1) { if ($.root().children().length === 1 && $.root().children('p').length === 1) {
html = $.children('p').html() html = $.root().children('p').html()
} }
} }
return html; return html;
@ -39,7 +39,7 @@ var common = {
var highlighted; var highlighted;
if (lang) { if (lang) {
try { try {
highlighted = highlight.highlight(lang, code).value; highlighted = highlight.highlight(code, { language: lang }).value;
} catch (e) {} } catch (e) {}
} }
if (!highlighted) { if (!highlighted) {

View File

@ -56,7 +56,7 @@ function fetchReference(ref) {
src = fs.readFileSync(file, "utf8") src = fs.readFileSync(file, "utf8")
} }
if (file.indexOf(".yml") > -1 || file.indexOf(".yaml") > -1) { if (file.indexOf(".yml") > -1 || file.indexOf(".yaml") > -1) {
src = yaml.safeLoad(src) src = yaml.load(src)
} else { } else {
src = JSON.parse(src) src = JSON.parse(src)
} }

View File

@ -7,8 +7,10 @@ var program = require('commander'),
// //
//= Process CLI input //= Process CLI input
program.version(package.version) program
.storeOptionsAsProperties()
.usage('[options] <specfile>') .usage('[options] <specfile>')
.version(package.version)
.description(package.description) .description(package.description)
.option('-C, --disable-css', 'omit CSS generation (default: false)') .option('-C, --disable-css', 'omit CSS generation (default: false)')
.option('-J, --disable-js', 'omit JavaScript generation (default: false)') .option('-J, --disable-js', 'omit JavaScript generation (default: false)')

10541
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,39 +34,40 @@
}, },
"homepage": "https://sourcey.com/spectacle", "homepage": "https://sourcey.com/spectacle",
"dependencies": { "dependencies": {
"bluebird": "^3.5.2", "bluebird": "^3.7.2",
"cheerio": "^1.0.0-rc.2", "cheerio": "^1.0.0-rc.10",
"clarify": "^2.1.0", "clarify": "^2.1.0",
"coffeescript": "^2.5.1",
"commander": "*", "commander": "*",
"foundation-sites": "^6.5.0-rc.4", "foundation-sites": "^6.6.3",
"grunt": "^1.0.3", "grunt": "^1.4.1",
"grunt-compile-handlebars": "^2.0.2", "grunt-compile-handlebars": "^2.0.2",
"grunt-contrib-clean": "^2.0.0", "grunt-contrib-clean": "^2.0.0",
"grunt-contrib-concat": "^1.0.1", "grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^2.0.0", "grunt-contrib-connect": "^3.0.0",
"grunt-contrib-copy": "^1.0.0", "grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^3.0.0", "grunt-contrib-cssmin": "^4.0.0",
"grunt-contrib-handlebars": "^1.0.0", "grunt-contrib-handlebars": "^3.0.0",
"grunt-contrib-jshint": "^2.0.0", "grunt-contrib-jshint": "^3.0.0",
"grunt-contrib-uglify": "^4.0.0", "grunt-contrib-uglify": "^5.0.1",
"grunt-contrib-watch": "^1.1.0", "grunt-contrib-watch": "^1.1.0",
"grunt-embed": "^0.2.1", "grunt-embed": "^0.2.1",
"grunt-prettify": "^0.4.0", "grunt-prettify": "^0.4.0",
"grunt-sass": "^3.0.2", "grunt-sass": "^3.1.0",
"handlebars": "^4.0.12", "handlebars": "^4.7.7",
"highlight.js": "^9.13.0", "highlight.js": "^11.0.1",
"js-yaml": "^3.12.0", "js-yaml": "^4.1.0",
"json-refs": "^3.0.12", "json-refs": "^3.0.15",
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"lodash": "^4.17.11", "lodash": "^4.17.21",
"marked": "^0.6.1", "marked": "^2.1.3",
"node-sass": "^4.14.1", "node-sass": "^6.0.1",
"sync-request": "^6.0.0", "sync-request": "^6.1.0",
"tmp": "0.0.33", "tmp": "^0.2.1",
"trace": "^3.1.0" "trace": "^3.1.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.4",
"mocha": "^5.2.0" "mocha": "^9.0.2"
} }
} }