From ed02017bca99fe90045ae6937016e22eb12f0c4e Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Sat, 23 Mar 2024 21:41:03 -0700 Subject: [PATCH] vtt2ass: Make sure cc's with pos data aren't merged --- modules/module.vtt2ass.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/module.vtt2ass.ts b/modules/module.vtt2ass.ts index dea39ff..01c2a8d 100644 --- a/modules/module.vtt2ass.ts +++ b/modules/module.vtt2ass.ts @@ -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);