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
Branches
No related tags found
No related merge requests found
function myCustomCleanup(type, value) { function myCustomCleanup(type, value) {
switch (type) { switch (type) {
case "get_from_editor": 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 // Do custom cleanup code here
break; break;
} }
...@@ -30,5 +31,4 @@ tinyMCE.init({ ...@@ -30,5 +31,4 @@ tinyMCE.init({
+ "-span[style]," + "-span[style],"
+ "br", + "br",
cleanup_callback : "myCustomCleanup" 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.
Please register or to comment