Allow override of HTML escaping in code blocks

This way, authors can use HTML for special formatting.
This commit is contained in:
Eric Weikl 2013-05-05 16:03:42 +02:00
parent 4d89687fde
commit 88eb0af776

View File

@ -11,8 +11,10 @@
element.innerHTML = element.innerHTML.trim(); element.innerHTML = element.innerHTML.trim();
} }
// Now escape html // Now escape html unless prevented by author
element.innerHTML = element.innerHTML.replace(/</g,"&lt;").replace(/>/g,"&gt;"); if( ! element.hasAttribute( 'data-noescape' )) {
element.innerHTML = element.innerHTML.replace(/</g,"&lt;").replace(/>/g,"&gt;");
}
// re-highlight when focus is lost (for edited code) // re-highlight when focus is lost (for edited code)
element.addEventListener( 'focusout', function( event ) { element.addEventListener( 'focusout', function( event ) {