mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 18:11:20 -08:00
21 lines
563 B
TypeScript
21 lines
563 B
TypeScript
// 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, '>')
|
|
}
|