mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Remove most tags and attributes not needed in this editor
This commit is contained in:
parent
237637b2ef
commit
f471e16636
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue