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();
|
||||
}
|
||||
|
||||
// Now escape html
|
||||
element.innerHTML = element.innerHTML.replace(/</g,"<").replace(/>/g,">");
|
||||
// Now escape html unless prevented by author
|
||||
if( ! element.hasAttribute( 'data-noescape' )) {
|
||||
element.innerHTML = element.innerHTML.replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
|
||||
// re-highlight when focus is lost (for edited code)
|
||||
element.addEventListener( 'focusout', function( event ) {
|
||||
|
Loading…
Reference in New Issue
Block a user