Skip to content

Commit

Permalink
[unescaped markup] Fixed bug with escaped </script>
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed Feb 15, 2016
1 parent 07d77e5 commit ad30c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/unescaped-markup/prism-unescaped-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Prism.plugins.UnescapedMarkup = true;

Prism.hooks.add('before-highlightall', function (env) { console.log(env);
Prism.hooks.add('before-highlightall', function (env) {
env.selector += ", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain']" +
", script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup";
});
Expand All @@ -21,6 +21,8 @@
var pre = document.createElement("pre");

pre.className = code.className = env.element.className;

env.code = env.code.replace(/&lt;\/script(>|&gt;)/gi, "</scri" + "pt>");
code.textContent = env.code;

pre.appendChild(code);
Expand Down
2 changes: 1 addition & 1 deletion plugins/unescaped-markup/prism-unescaped-markup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad30c32

Please sign in to comment.