Skip to content
Snippets Groups Projects
Commit 5f1cc490 authored by Tim Steiner's avatar Tim Steiner
Browse files

better regex for:

tinymce config update to strip out html comments
parent 63434f31
No related branches found
No related tags found
No related merge requests found
function myCustomCleanup(type, value) {
switch (type) {
case "get_from_editor":
value = value.replace(/<(!--)([\s\S]*)(--)>/gi, "");
value = value.replace(/&lt;![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)&gt;/gi, "");
value = value.replace(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/gi, "");
// Do custom cleanup code here
break;
}
......@@ -30,5 +31,4 @@ tinyMCE.init({
+ "-span[style],"
+ "br",
cleanup_callback : "myCustomCleanup"
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment