projects
/
reveal.js.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
247771e
)
Adds support for auto escaping HTML in code blocks.
author
Raymond Camden
<raymondcamden@gmail.com>
Wed, 1 May 2013 19:29:56 +0000
(14:29 -0500)
committer
Raymond Camden
<raymondcamden@gmail.com>
Wed, 1 May 2013 19:29:56 +0000
(14:29 -0500)
js/reveal.js
patch
|
blob
|
history
diff --git
a/js/reveal.js
b/js/reveal.js
index a4a71db49240dc5be52e95a39c91c4f64d318bda..f9590d5a3bcca7b405593c09f357e8746c756bcb 100644
(file)
--- 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;
+ }
+ }
+
}
/**