Compare commits

..

2 Commits

Author SHA1 Message Date
Cohee d63638541b
Merge pull request #2099 from aisu-wata0/fix_css_decode_style
fix: css `decodeStyles`: remove `</br>` tags before parsing
2024-04-17 11:35:54 +03:00
Aisu Wata fc380fa522 fix: css `decodeStyles`: remove `</br>` tags before parsing 2024-04-17 01:15:55 -03:00
1 changed files with 2 additions and 1 deletions

View File

@ -395,7 +395,8 @@ export function decodeStyleTags(text) {
return text.replaceAll(styleDecodeRegex, (_, style) => { return text.replaceAll(styleDecodeRegex, (_, style) => {
try { try {
const ast = css.parse(unescape(style)); let styleCleaned = unescape(style).replaceAll(/<br\/>/g, '');
const ast = css.parse(styleCleaned);
const rules = ast?.stylesheet?.rules; const rules = ast?.stylesheet?.rules;
if (rules) { if (rules) {
for (const rule of rules) { for (const rule of rules) {