Skip to content

Commit e2165fd

Browse files
Fixed code issues due the dependencies update
1 parent 0802dec commit e2165fd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/lib/common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ var common = {
2626
var html = marked(value)
2727
// We strip the surrounding <p>-tag, if
2828
if (stripParagraph) {
29-
var $ = cheerio("<root>" + html + "</root>")
29+
var $ = cheerio.load("<root>" + html + "</root>")
3030
// Only strip <p>-tags and only if there is just one of them.
31-
if ($.children().length === 1 && $.children('p').length === 1) {
32-
html = $.children('p').html()
31+
if ($.root().children().length === 1 && $.root().children('p').length === 1) {
32+
html = $.root().children('p').html()
3333
}
3434
}
3535
return html;
@@ -39,7 +39,7 @@ var common = {
3939
var highlighted;
4040
if (lang) {
4141
try {
42-
highlighted = highlight.highlight(lang, code).value;
42+
highlighted = highlight.highlight(code, { language: lang }).value;
4343
} catch (e) {}
4444
}
4545
if (!highlighted) {

app/lib/resolve-references.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function fetchReference(ref) {
5656
src = fs.readFileSync(file, "utf8")
5757
}
5858
if (file.indexOf(".yml") > -1 || file.indexOf(".yaml") > -1) {
59-
src = yaml.safeLoad(src)
59+
src = yaml.load(src)
6060
} else {
6161
src = JSON.parse(src)
6262
}

0 commit comments

Comments
 (0)