From 9a171c36ec2cade1ea813ecc0394b8fff73a1ec2 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 1 Jun 2023 01:43:36 -0400 Subject: [PATCH] Remove ssa/ass tags from text subtitles --- src/plugins/htmlVideoPlayer/plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 9ad2b6ddac..fd4f7f1306 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -137,7 +137,10 @@ function zoomIn(elem) { } function normalizeTrackEventText(text, useHtml) { - const result = text.replace(/\\N/gi, '\n').replace(/\r/gi, ''); + const result = text + .replace(/\\N/gi, '\n') // Correct newline characters + .replace(/\r/gi, '') // Remove carriage return characters + .replace(/{\\.*?}/gi, ''); // Remove ass/ssa tags return useHtml ? result.replace(/\n/gi, '
') : result; }