1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Remove ssa/ass tags from text subtitles

This commit is contained in:
Bill Thornton 2023-06-01 01:43:36 -04:00
parent 22d866c61d
commit 9a171c36ec

View file

@ -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, '<br>') : result;
}