Skip to content
Snippets Groups Projects
Commit 0441c26b authored by Raymond Camden's avatar Raymond Camden
Browse files

Adds support for auto escaping HTML in code blocks.

parent 247771e1
No related branches found
No related tags found
No related merge requests found
...@@ -235,6 +235,18 @@ var Reveal = (function(){ ...@@ -235,6 +235,18 @@ var Reveal = (function(){
dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) ); dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) );
} }
//Auto scape code blocks
var cblocks = document.querySelectorAll("pre code");
if(cblocks.length) {
for(var i=0, len=cblocks.length; i<len; i++) {
var thisDom = cblocks[i];
var html = thisDom.innerHTML;
html = html.replace(/</g,"&lt;").replace(/>/g,"&gt;");
thisDom.innerHTML = html;
}
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment