javascript - How to configure CKEditor to strip <script> tags from <head>? -


i'm using following code in ckeditor 4.5.8 config file strip <svg> , <script> tags html content being edited in ckeditor.

config.allowedcontent = {     $1: {         // use ability specify elements object.         elements: ckeditor.dtd,         attributes: true,         styles: true,         classes: true     } };  config.disallowedcontent = 'svg;script;'; 

these tags stripped out fine when they're included within <body>, tags remain when they're included within <head>. i'm particularly worried <script>s sticking around.

how should ckeditor configured strip <script> tags <head>? there deeper element of configuration i'm missing? in advance!

add additional parameter when initializing ckeditor. necessary if want edit entire html page, <html>, <head> , <body> elements, need set config.fullpage option true:

config.allowedcontent = {     $1: {         // use ability specify elements object.         elements: ckeditor.dtd,         attributes: true,         styles: true,         classes: true,         fullpage: true     } }; 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -