From f471e16636925d9bfbccc01eae9a5177f86af84c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 8 Jul 2020 19:58:10 +0900 Subject: [PATCH] Remove most tags and attributes not needed in this editor --- modules/editor/skins/simpleeditor/js/simpleeditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/editor/skins/simpleeditor/js/simpleeditor.js b/modules/editor/skins/simpleeditor/js/simpleeditor.js index a8181b04e..2cfda25b5 100644 --- a/modules/editor/skins/simpleeditor/js/simpleeditor.js +++ b/modules/editor/skins/simpleeditor/js/simpleeditor.js @@ -42,8 +42,9 @@ // Simplify HTML content by removing unnecessary tags. var simplifyContent = function(str) { str = String(str); - str = str.replace(//g, ''); - str = str.replace(/<\/?(\?xml|meta|link|font|style|script|noscript|frame|noframes)\b[^>]*?>/ig, ''); + str = str.replace(//gs, ''); + str = str.replace(/<\/?(\?xml|meta|link|font|span|style|script|noscript|frame|noframes|(?:st1|o):[a-z0-9]+)\b[^>]*?>/ig, ''); + str = str.replace(/(id|class|style|on(?:[a-z0-9]+)|Mso(?:[a-z0-9]+))="[^"]*"/ig, ''); str = str.replace(/(<\/?)div(\W)/g, '$1p$2'); return str; };