mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
Add unescape utility function and
artplayerPluginMultipleSubtitles plugin
This commit is contained in:
1 parent
3db53c425e
commit
89b8525f2f
47 files changed
+2982
-75
No files matched your search
@@ -32,3 +32,15 @@ export function escape(str) {
|
||||
})[tag] || tag,
|
||||
);
|
||||
}
|
||||
|
||||
export function unescape(str) {
|
||||
const map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
''': "'",
|
||||
'"': '"',
|
||||
};
|
||||
const reg = new RegExp(`(${Object.keys(map).join('|')})`, 'g');
|
||||
return str.replace(reg, (tag) => map[tag] || tag);
|
||||
}
|
||||
Reference in new issue
Block a user