From e84eb7d941c856a5ca65edcd666195898c44bd06 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 13 Feb 2024 02:33:32 +0100 Subject: [PATCH] Force default position to be higher --- index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 8e3cfa1..53b0c88 100644 --- a/index.ts +++ b/index.ts @@ -45,7 +45,9 @@ const toVTT = (utf8str: string) => utf8str .replace(/\{([ibu])\}/g, '<$1>') .replace(/\{\/([ibu])\}/g, '') .replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2') - .replace(/\r?\n\{\\an(\d)\}/, (_, pos) => srtPositionToLine(pos) + '\r\n') + .replace(/\r?\n\{\\an(\d)\}/g, (_, pos) => srtPositionToLine(pos) + '\r\n') + // force line:93% by default + .replace(/(\d\d:\d\d:\d\d.\d\d\d)\r?\n/g, '$1 line:93%\r\n') .concat('\r\n\r\n'); const srtPositionToLine = (pos: number) => {