Merge pull request #4658 from thornbill/no-ssa-in-srt

Remove ssa/ass tags from text subtitles
This commit is contained in:
Bill Thornton 2023-06-01 13:15:45 -04:00 committed by GitHub
commit 639e7dcad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,7 +137,10 @@ function zoomIn(elem) {
} }
function normalizeTrackEventText(text, useHtml) { 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; return useHtml ? result.replace(/\n/gi, '<br>') : result;
} }