From 215168b8f55ef6472ea53ffd59b59d2e7c993c64 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 25 Feb 2012 10:51:33 +0000 Subject: [PATCH] before passing subtitles to player, strip newlines, and replace
s with newlines --- static/js/pandora/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index bd6b4d1ae..2c6e178d7 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -798,7 +798,12 @@ pandora.getVideoOptions = function(data) { options = {}, subtitlesLayer = Ox.getObject(pandora.site.layers, 'isSubtitles', true); options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) { - return {id: subtitle.id, 'in': subtitle['in'], out: subtitle.out, text: subtitle.value}; + return { + id: subtitle.id, + 'in': subtitle['in'], + out: subtitle.out, + text: subtitle.value.replace(/\n/g, ' ').replace(//g, '\n') + }; }) : []; options.censored = canPlayVideo ? [] : canPlayClips ? (