diff options
author | Raymond Camden <raymondcamden@gmail.com> | 2013-05-01 14:29:56 -0500 |
---|---|---|
committer | Raymond Camden <raymondcamden@gmail.com> | 2013-05-01 14:29:56 -0500 |
commit | 0441c26be1bc0df805db9313827309a08c98487a (patch) | |
tree | b8f30c95b7faf71ee0493632fcb5576c9db25654 /js | |
parent | 247771e129f431fc751140d8da4c2fe60815a51f (diff) | |
download | perl-software-in-gnu-guix-0441c26be1bc0df805db9313827309a08c98487a.tar perl-software-in-gnu-guix-0441c26be1bc0df805db9313827309a08c98487a.tar.gz |
Adds support for auto escaping HTML in code blocks.
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js index a4a71db..f9590d5 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -235,6 +235,18 @@ var Reveal = (function(){ 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,"<").replace(/>/g,">"); + thisDom.innerHTML = html; + } + } + } /** |