mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
fix(multiple-subtitles): [PKG-MULTI-SUB-08] preserve entity text and semantic cue wrappers
This commit is contained in:
1 parent
4acf85ea69
commit
675b095b27
22 files changed
+744
-59
No files matched your search
@@ -0,0 +1,20 @@
|
||||
// Keep the vendor's lenient aliases while making complete named references exact.
|
||||
export const cueEntities = {
|
||||
'&': '&',
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'>': '>',
|
||||
'&lrm': '\u200E',
|
||||
'‎': '\u200E',
|
||||
'&rlm': '\u200F',
|
||||
'‏': '\u200F',
|
||||
' ': '\u00A0',
|
||||
' ': '\u00A0',
|
||||
}
|
||||
|
||||
// Serialization protects the whole VTT once; this protects cue text after onVttLoad unescape.
|
||||
export function escapeCueText(value: string): string {
|
||||
return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
}
|
||||
Reference in new issue
Block a user