aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/highlight/highlight.js6
1 files changed, 4 insertions, 2 deletions
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,"&lt;").replace(/>/g,"&gt;");
+ // Now escape html unless prevented by author
+ if( ! element.hasAttribute( 'data-noescape' )) {
+ element.innerHTML = element.innerHTML.replace(/</g,"&lt;").replace(/>/g,"&gt;");
+ }
// re-highlight when focus is lost (for edited code)
element.addEventListener( 'focusout', function( event ) {