mirror of
https://github.com/zoriya/srt-webvtt.git
synced 2026-06-09 20:15:33 +00:00
Force default position to be higher
This commit is contained in:
@@ -45,7 +45,9 @@ const toVTT = (utf8str: string) => utf8str
|
|||||||
.replace(/\{([ibu])\}/g, '<$1>')
|
.replace(/\{([ibu])\}/g, '<$1>')
|
||||||
.replace(/\{\/([ibu])\}/g, '</$1>')
|
.replace(/\{\/([ibu])\}/g, '</$1>')
|
||||||
.replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2')
|
.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');
|
.concat('\r\n\r\n');
|
||||||
|
|
||||||
const srtPositionToLine = (pos: number) => {
|
const srtPositionToLine = (pos: number) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user