Commit 88eb0af7 authored by Eric Weikl's avatar Eric Weikl
Browse files

Allow override of HTML escaping in code blocks

This way, authors can use HTML for special formatting.
parent 4d89687f
......@@ -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 ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment