fix(multiple-subtitles): repair old ASS conversion line breaks [PKG-MULTI-SUB-11]

This commit is contained in:
Harvey Zhao committed 2026-09-14 13:42:46 +08:00
1 parent 8ae2762a23
commit 318de37e8a
22 files changed
+3268 -27

No files matched your search

@@ -1,4 +1,5 @@
import type { Converters, Lifetime, TrackOption } from './types'
import convertAss from './ass-conversion'
export default async function loadVtt(option: TrackOption, { getExt, srtToVtt, assToVtt }: Converters, lifetime: Lifetime): Promise<string | void> {
if (lifetime.closed)
@@ -21,7 +22,7 @@ export default async function loadVtt(option: TrackOption, { getExt, srtToVtt, a
const text = new TextDecoder(option.encoding || 'utf-8').decode(buffer!)
switch (option.type || getExt(option.url!)) {
case 'srt': return srtToVtt(text)
case 'ass': return assToVtt(text)
case 'ass': return convertAss(text, assToVtt)
case 'vtt': return text
default: return ''
}