aboutsummaryrefslogtreecommitdiff
path: root/plugin/markdown
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2013-07-31 08:37:53 -0400
committerHakim El Hattab <hakim.elhattab@gmail.com>2013-07-31 08:37:53 -0400
commitfe90f2b8c7eb35ae0aae7741e4c687e016740508 (patch)
tree1e0dd0ffe021c8447d64ad1b8115f51e8dd7b31e /plugin/markdown
parent53f1f110c8066b40c788b59e663d303446e3819d (diff)
parentefbcab57f74891a060320af1c9e2e3c039febc5a (diff)
downloadfosdem-2018-presentation-fe90f2b8c7eb35ae0aae7741e4c687e016740508.tar
fosdem-2018-presentation-fe90f2b8c7eb35ae0aae7741e4c687e016740508.tar.gz
Merge branch 'bug/markdown' of https://github.com/snowyu/reveal.js into dev
Diffstat (limited to 'plugin/markdown')
-rwxr-xr-xplugin/markdown/markdown.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js
index 9681cf1..a5abc30 100755
--- a/plugin/markdown/markdown.js
+++ b/plugin/markdown/markdown.js
@@ -6,6 +6,14 @@
throw 'The reveal.js Markdown plugin requires marked to be loaded';
}
+ if (typeof hljs !== 'undefined') {
+ marked.setOptions({
+ highlight: function (lang, code) {
+ return hljs.highlightAuto(lang, code).value;
+ }
+ });
+ }
+
var stripLeadingWhitespace = function(section) {
var template = section.querySelector( 'script' );
@@ -28,7 +36,7 @@
};
var twrap = function(el) {
- return '<script type="text/template">' + el + '</script>';
+ return marked(el);
};
var getForwardedAttributes = function(section) {
@@ -51,7 +59,7 @@
}
return result.join( ' ' );
- }
+ };
var slidifyMarkdown = function(markdown, separator, vertical, attributes) {
@@ -101,12 +109,12 @@
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
// horizontal
if( typeof sectionStack[k] === 'string' ) {
- markdownSections += '<section '+ attributes +' data-markdown>' + twrap( sectionStack[k] ) + '</section>';
+ markdownSections += '<section '+ attributes +'>' + twrap( sectionStack[k] ) + '</section>';
}
// vertical
else {
markdownSections += '<section '+ attributes +'>' +
- '<section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section>' +
+ '<section>' + sectionStack[k].map(twrap).join('</section><section>') + '</section>' +
'</section>';
}
}