eslint fixes

This commit is contained in:
AnimeDL 2023-07-05 11:11:35 -07:00
parent abefc563d6
commit a17677c3bf

View file

@ -82,6 +82,8 @@ function parseStyle(stylegroup: string, line: string, style: any) {
for (const s of line.split(';')) {
if (s == '') continue;
const st = s.trim().split(':');
const transformed_str = st[1].split(',').map(r => r.trim());
let arr = transformed_str[1].split(',').map(r => r.trim());
let cl;
switch (st[0]) {
case 'font-family':
@ -138,8 +140,7 @@ function parseStyle(stylegroup: string, line: string, style: any) {
if (stylegroup.startsWith('Subtitle') || stylegroup.startsWith('Song')) { //don't touch shadow if dialog
break;
}
let transformed_str = st[1].split(',').map(r => r.trim());
let arr = transformed_str[1].split(',').map(r => r.trim());
arr = arr.map(r => { return (r.split(' ').length > 3 ? r.replace(/(\d+)px black$/, '') : r.replace(/black$/, '')).trim(); });
transformed_str[1] = arr.map(r => r.replace(/-/g, '').replace(/px/g, '').replace(/(^| )0( |$)/g, ' ').trim()).join(' ');
arr = transformed_str[1].split(' ');