Comparing version 1.1.2 to 1.1.3
@@ -15,3 +15,5 @@ var split = require('split2') | ||
.replace(/\{\/([ibu])\}/g, '</$1>') | ||
.replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2') + '\r\n\r\n' | ||
.replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g, '$1.$2') | ||
.replace(/\r\n\{\\an8\}/g, ' line:5%\r\n') + | ||
'\r\n\r\n' | ||
} | ||
@@ -18,0 +20,0 @@ |
{ | ||
"name": "srt-to-vtt", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Transform stream that converts srt files to vtt files (html5 video subtitles)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,2 +25,12 @@ var tape = require('tape') | ||
tape('one entry with position an8', function (t) { | ||
var convert = srt2vtt() | ||
convert.write('1\r\n00:00:35.490 --> 00:00:38.720\r\n{\\an8}<i><font color="#ffff00">hello\r\n\r\n') | ||
convert.end() | ||
convert.pipe(concat(function (data) { | ||
t.same(data.toString(), 'WEBVTT FILE\r\n\r\n1\r\n00:00:35.490 --> 00:00:38.720 line:5%\r\n<i><font color="#ffff00">hello\r\n\r\n') | ||
t.end() | ||
})) | ||
}) | ||
tape('two entries', function (t) { | ||
@@ -27,0 +37,0 @@ var convert = srt2vtt() |
6901
108