Skip to content

Commit fe90f2b

Browse files
committed
Merge branch 'bug/markdown' of https://github.com/snowyu/reveal.js into dev
2 parents 53f1f11 + efbcab5 commit fe90f2b

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

plugin/markdown/markdown.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
throw 'The reveal.js Markdown plugin requires marked to be loaded';
77
}
88

9+
if (typeof hljs !== 'undefined') {
10+
marked.setOptions({
11+
highlight: function (lang, code) {
12+
return hljs.highlightAuto(lang, code).value;
13+
}
14+
});
15+
}
16+
917
var stripLeadingWhitespace = function(section) {
1018

1119
var template = section.querySelector( 'script' );
@@ -28,7 +36,7 @@
2836
};
2937

3038
var twrap = function(el) {
31-
return '<script type="text/template">' + el + '</script>';
39+
return marked(el);
3240
};
3341

3442
var getForwardedAttributes = function(section) {
@@ -51,7 +59,7 @@
5159
}
5260

5361
return result.join( ' ' );
54-
}
62+
};
5563

5664
var slidifyMarkdown = function(markdown, separator, vertical, attributes) {
5765

@@ -101,12 +109,12 @@
101109
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
102110
// horizontal
103111
if( typeof sectionStack[k] === 'string' ) {
104-
markdownSections += '<section '+ attributes +' data-markdown>' + twrap( sectionStack[k] ) + '</section>';
112+
markdownSections += '<section '+ attributes +'>' + twrap( sectionStack[k] ) + '</section>';
105113
}
106114
// vertical
107115
else {
108116
markdownSections += '<section '+ attributes +'>' +
109-
'<section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section>' +
117+
'<section>' + sectionStack[k].map(twrap).join('</section><section>') + '</section>' +
110118
'</section>';
111119
}
112120
}

0 commit comments

Comments
 (0)