srt newlines are \r\n; add utf-8 BOM, fixes #2556
This commit is contained in:
parent
50b344321e
commit
4a354aa59e
1 changed files with 3 additions and 3 deletions
|
@ -744,15 +744,15 @@ Ox.formatRoman = function(number) {
|
|||
Ox.formatSRT <f> Formats subtitles as SRT
|
||||
@*/
|
||||
Ox.formatSRT = function(subtitles) {
|
||||
return Ox.sortBy(subtitles, ['in', 'out']).map(function(subtitle, index) {
|
||||
return '\ufeff' + Ox.sortBy(subtitles, ['in', 'out']).map(function(subtitle, index) {
|
||||
return [
|
||||
index + 1,
|
||||
['in', 'out'].map(function(key) {
|
||||
return Ox.formatDuration(subtitle[key], 3).replace('.', ',');
|
||||
}).join(' --> '),
|
||||
subtitle['text']
|
||||
].join('\n')
|
||||
}).join('\n\n');
|
||||
].join('\r\n')
|
||||
}).join('\r\n\r\n');
|
||||
};
|
||||
|
||||
/*@
|
||||
|
|
Loading…
Reference in a new issue