Allow override of HTML escaping in code blocks
This way, authors can use HTML for special formatting.
This commit is contained in:
parent
4d89687fde
commit
88eb0af776
|
@ -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,"<").replace(/>/g,">");
|
if( ! element.hasAttribute( 'data-noescape' )) {
|
||||||
|
element.innerHTML = element.innerHTML.replace(/</g,"<").replace(/>/g,">");
|
||||||
|
}
|
||||||
|
|
||||||
// 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 ) {
|
||||||
|
|
Loading…
Reference in New Issue