Update markdown.js

Allow HTML tags in external markdown files
This commit is contained in:
ynonp 2013-03-01 18:47:26 +02:00
parent 7081f901da
commit 34afc564cd
1 changed files with 7 additions and 3 deletions

View File

@ -26,7 +26,11 @@
return text; return text;
}; };
var twrap = function(el) {
return '<script type="text/template">' + el + '</script>';
};
var slidifyMarkdown = function(markdown, separator, vertical) { var slidifyMarkdown = function(markdown, separator, vertical) {
separator = separator || '^\n---\n$'; separator = separator || '^\n---\n$';
@ -74,8 +78,8 @@
// flatten the hierarchical stack, and insert <section data-markdown> tags // flatten the hierarchical stack, and insert <section data-markdown> tags
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) { for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
markdownSections += typeof sectionStack[k] === 'string' markdownSections += typeof sectionStack[k] === 'string'
? '<section data-markdown>' + sectionStack[k] + '</section>' ? '<section data-markdown>' + twrap( sectionStack[k] ) + '</section>'
: '<section><section data-markdown>' + sectionStack[k].join('</section><section data-markdown>') + '</section></section>'; : '<section><section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section></section>';
} }
return markdownSections; return markdownSections;