diff --git a/out/PiPer.safariextz b/out/PiPer.safariextz index 7baf02a..81fa15e 100644 Binary files a/out/PiPer.safariextz and b/out/PiPer.safariextz differ diff --git a/src/scripts/main.js b/src/scripts/main.js index 66d06e2..239daa6 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -159,9 +159,16 @@ const processCaptions = function() { const walk = document.createTreeWalker(captionElement, NodeFilter.SHOW_TEXT, null, false); while (walk.nextNode()) { const segment = walk.currentNode.nodeValue.trim(); - caption += segment ? segment + ' ' : '\n'; + if (segment) { + caption += segment + ' '; + } else if (caption.charAt(caption.length - 1) != '\n') { + caption += '\n'; + } else { + caption += ''; + } } - log('Showing caption "' + caption.trim() + '"'); + caption = caption.trim(); + log('Showing caption "' + caption + '"'); track.addCue(new VTTCue(video.currentTime, video.currentTime + 60, caption)); }; diff --git a/update.plist b/update.plist index 24f1c78..ff35f1f 100644 --- a/update.plist +++ b/update.plist @@ -10,7 +10,7 @@ CFBundleShortVersionString 0.2.0 CFBundleVersion - 38 + 39 Developer Identifier BQ6Q24MF9X URL