From: Eric Weikl Date: Sun, 5 May 2013 14:03:42 +0000 (+0200) Subject: Allow override of HTML escaping in code blocks X-Git-Tag: 2.4.0 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=88eb0af776bce5e07a21d030142c335d3c77cab1;p=reveal.js.git Allow override of HTML escaping in code blocks This way, authors can use HTML for special formatting. --- diff --git a/plugin/highlight/highlight.js b/plugin/highlight/highlight.js index 5a6ad90..3f3bea6 100644 --- a/plugin/highlight/highlight.js +++ b/plugin/highlight/highlight.js @@ -11,8 +11,10 @@ element.innerHTML = element.innerHTML.trim(); } - // Now escape html - element.innerHTML = element.innerHTML.replace(//g,">"); + // Now escape html unless prevented by author + if( ! element.hasAttribute( 'data-noescape' )) { + element.innerHTML = element.innerHTML.replace(//g,">"); + } // re-highlight when focus is lost (for edited code) element.addEventListener( 'focusout', function( event ) {