Regex modified for charset in HTML source code

This commit is contained in:
nobody 2020-05-21 20:26:41 +02:00
parent 2840cd6d1b
commit 65ae6f6e79
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) {
let htmlHead = asciiDecoder.decode(evt.data, {stream: false});
let charsetMatch = htmlHead.match(/<meta\s+charset=["']?([^>"'\/]+)["'>\/]/i);
if (!charsetMatch) {
charsetMatch = htmlHead.match(/<meta\s+http-equiv=["']?content-type["']?\s+content=["']?text\/html;\s+charset=([^>"'\/]+)["'>\/]/i);
charsetMatch = htmlHead.match(/<meta\s+http-equiv=["']?content-type["']?\s+content=["']?text\/html;\s*charset=([^>"'\/]+)["'>\/]/i);
}
charset = charsetMatch ? charsetMatch[1] : "UTF-8";
}