vtt2ass: Make sure cc's with pos data aren't merged

This commit is contained in:
AnimeDL 2024-03-23 21:41:03 -07:00
parent 69336c5c6e
commit ed02017bca

View file

@ -286,7 +286,14 @@ function convert(css: Css, vtt: Vtt[]) {
* This checks if a subtitle should be multi-line, and if it is, pops the just inserted
* subtitle and the previous subtitle, and merges them into a single subtitle.
*/
if (previousLine?.start == x.start && previousLine.type == x.type && previousLine.style == x.style) {
console.debug(previousLine?.text);
if (
previousLine?.start == x.start &&
previousLine.type == x.type &&
previousLine.style == x.style &&
!previousLine?.text.includes('\\pos') &&
!x.text.includes('\\pos')
) {
events[x.type as keyof typeof events].pop();
const previousLinePop = events[x.type as keyof typeof events].pop();
events[x.type as keyof typeof events].push(previousLinePop + '\\N'+x.text);