mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Fix #1361 always add at least one <p> tag
This commit is contained in:
parent
8ef75ea63f
commit
6c0e3ace1f
1 changed files with 3 additions and 0 deletions
|
|
@ -46,6 +46,9 @@
|
|||
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');
|
||||
if (!str.match(/<\/?p>/)) {
|
||||
str = '<p>' + str + '</p>';
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue