1
0
Fork 0
This commit is contained in:
Hakim El Hattab 2015-07-07 12:06:22 +02:00
commit 399d4f652d
1 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,8 @@
// strip leading whitespace so it isn't evaluated as code // strip leading whitespace so it isn't evaluated as code
var text = ( template || section ).textContent; var text = ( template || section ).textContent;
// restore script end tag
text = text.replace(/__SCRIPT_END__/g, '</script>');
var leadingWs = text.match( /^\n?(\s*)/ )[1].length, var leadingWs = text.match( /^\n?(\s*)/ )[1].length,
leadingTabs = text.match( /^\n?(\t*)/ )[1].length; leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
@ -114,7 +115,8 @@
if( notesMatch.length === 2 ) { if( notesMatch.length === 2 ) {
content = notesMatch[0] + '<aside class="notes" data-markdown>' + notesMatch[1].trim() + '</aside>'; content = notesMatch[0] + '<aside class="notes" data-markdown>' + notesMatch[1].trim() + '</aside>';
} }
//handle script end tag bug
content = content.replace(/<\/script>/g, '__SCRIPT_END__');
return '<script type="text/template">' + content + '</script>'; return '<script type="text/template">' + content + '</script>';
} }