File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ var common = {
26
26
var html = marked ( value )
27
27
// We strip the surrounding <p>-tag, if
28
28
if ( stripParagraph ) {
29
- var $ = cheerio ( "<root>" + html + "</root>" )
29
+ var $ = cheerio . load ( "<root>" + html + "</root>" )
30
30
// 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 ( )
33
33
}
34
34
}
35
35
return html ;
@@ -39,7 +39,7 @@ var common = {
39
39
var highlighted ;
40
40
if ( lang ) {
41
41
try {
42
- highlighted = highlight . highlight ( lang , code ) . value ;
42
+ highlighted = highlight . highlight ( code , { language : lang } ) . value ;
43
43
} catch ( e ) { }
44
44
}
45
45
if ( ! highlighted ) {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function fetchReference(ref) {
56
56
src = fs . readFileSync ( file , "utf8" )
57
57
}
58
58
if ( file . indexOf ( ".yml" ) > - 1 || file . indexOf ( ".yaml" ) > - 1 ) {
59
- src = yaml . safeLoad ( src )
59
+ src = yaml . load ( src )
60
60
} else {
61
61
src = JSON . parse ( src )
62
62
}
You can’t perform that action at this time.
0 commit comments