aboutsummaryrefslogtreecommitdiff
path: root/plugin/markdown
diff options
context:
space:
mode:
authorBoris Fritscher <bfritscher@hotmail.com>2015-04-12 15:15:57 +0200
committerBoris Fritscher <bfritscher@hotmail.com>2015-04-12 15:15:57 +0200
commit9645a763c36347ead9dc5c070d226865ca9e8d90 (patch)
treefaf2611a98213e2e107833d5aa078c2a6015d891 /plugin/markdown
parent8858ee75a5b5a74c4ed102555c7baaa0f5d29ecd (diff)
downloadfreenode-live-2017-presentation-9645a763c36347ead9dc5c070d226865ca9e8d90.tar
freenode-live-2017-presentation-9645a763c36347ead9dc5c070d226865ca9e8d90.tar.gz
handle the </script> end bug inside code markdown
by changing the tag before html is parsed and restoring it before markdown parsing
Diffstat (limited to 'plugin/markdown')
-rwxr-xr-xplugin/markdown/markdown.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js
index 9afee06..738195f 100755
--- a/plugin/markdown/markdown.js
+++ b/plugin/markdown/markdown.js
@@ -42,7 +42,8 @@
// strip leading whitespace so it isn't evaluated as code
var text = ( template || section ).textContent;
-
+ // restore script end tag
+ text = text.replace(/__SCRIPT_END__/g, '</script>');
var leadingWs = text.match( /^\n?(\s*)/ )[1].length,
leadingTabs = text.match( /^\n?(\t*)/ )[1].length;
@@ -114,7 +115,8 @@
if( notesMatch.length === 2 ) {
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>';
}