Fix text-shadow parsing error in vtt2ass

Should hopefully fix the warnings about text-shadow being improperly parsed
This commit is contained in:
AnimeDL 2023-07-05 21:21:48 -07:00
parent 0fcf1e95bf
commit 5dfea78822

View file

@ -138,8 +138,7 @@ function parseStyle(stylegroup: string, line: string, style: any) {
if (stylegroup.startsWith('Subtitle') || stylegroup.startsWith('Song')) { //don't touch shadow if dialog
break;
}
transformed_str = st[1].split(',').map(r => r.trim());
arr = transformed_str[1].split(',').map(r => r.trim());
arr = transformed_str = st[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(' ');