Moved my code to auto escape html to the right place
This commit is contained in:
parent
0441c26be1
commit
b649c19af9
2 changed files with 3 additions and 12 deletions
|
@ -11,6 +11,9 @@
|
|||
element.innerHTML = element.innerHTML.trim();
|
||||
}
|
||||
|
||||
// Now escape html
|
||||
element.innerHTML = element.innerHTML.replace(/</g,"<").replace(/>/g,">");
|
||||
|
||||
// re-highlight when focus is lost (for edited code)
|
||||
element.addEventListener( 'focusout', function( event ) {
|
||||
hljs.highlightBlock( event.currentTarget );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue