Bugfix: removeColors sometimes broke HTML elements

This commit is contained in:
djmaze 2021-03-12 11:24:48 +01:00
parent 6a454ec624
commit 8b2d183f07

View file

@ -57,8 +57,8 @@ const
do {
l = html.length;
html = html
.replace(/(<[^>]+)[;"']\s*background(-[a-z]+)?\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+)[;"']\s*color\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+[;"'])\s*background(-[a-z]+)?\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+[;"'])\s*color\s*:[^;"']+/gi, '$1')
.replace(/(<[^>]+)\s(bg)?color=("[^"]+"|'[^']+')/gi, '$1');
} while (l != html.length)
return html;