Merge pull request #4895 from thornbill/subs-text-dir

Use LTR for default subtitle direction
This commit is contained in:
Bill Thornton 2024-01-05 16:00:05 -05:00 committed by GitHub
commit 0a509d682a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,9 @@ function normalizeTrackEventText(text, useHtml) {
const result = text
.replace(/\\N/gi, '\n') // Correct newline characters
.replace(/\r/gi, '') // Remove carriage return characters
.replace(/{\\.*?}/gi, ''); // Remove ass/ssa tags
.replace(/{\\.*?}/gi, '') // Remove ass/ssa tags
// Force LTR as the default direction
.split('\n').map(val => `\u200E${val}`).join('\n');
return useHtml ? result.replace(/\n/gi, '<br>') : result;
}