From: Raymond Camden Date: Wed, 1 May 2013 19:44:53 +0000 (-0500) Subject: Moved my code to auto escape html to the right place X-Git-Tag: 2.4.0~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b649c19af95d0494aa2127eb2069d2a7f108ab72;p=reveal.js.git Moved my code to auto escape html to the right place --- diff --git a/js/reveal.js b/js/reveal.js index f9590d5..a4a71db 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -235,18 +235,6 @@ 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/g,">"); - thisDom.innerHTML = html; - } - } - } /** diff --git a/plugin/highlight/highlight.js b/plugin/highlight/highlight.js index 6756359..5a6ad90 100644 --- a/plugin/highlight/highlight.js +++ b/plugin/highlight/highlight.js @@ -11,6 +11,9 @@ element.innerHTML = element.innerHTML.trim(); } + // Now escape html + element.innerHTML = element.innerHTML.replace(//g,">"); + // re-highlight when focus is lost (for edited code) element.addEventListener( 'focusout', function( event ) { hljs.highlightBlock( event.currentTarget );