1
0
mirror of https://github.com/aureliendavid/rsspreview.git synced 2025-08-23 03:38:44 +00:00

handle titles with html entities as html titles (#80)

This commit is contained in:
Aurelien David 2023-07-03 16:09:40 +02:00
parent 94c35d9051
commit b9f80de6ac
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "RSSPreview", "name": "RSSPreview",
"version": "3.20.2", "version": "3.21",
"author": "Aurelien David", "author": "Aurelien David",
"homepage_url": "https://github.com/aureliendavid/rsspreview", "homepage_url": "https://github.com/aureliendavid/rsspreview",

View File

@ -169,12 +169,14 @@
//basically removes html content if there is some //basically removes html content if there is some
//only do it if there's a tag to avoid doing it when text titles cointain a '&' //only do it if there's a tag to avoid doing it when text titles cointain a '&'
//(which can be caught but still displays an error in console, which is annoying) //(which can be caught but still displays an error in console, which is annoying)
if (et[i].innerText.indexOf('<') >= 0) { if (et[i].innerText.indexOf('<') >= 0 || et[i].innerText.indexOf('&amp;')) {
console.log(et[i].innerText);
let tmp = document.createElement('span'); let tmp = document.createElement('span');
try { try {
tmp.innerHTML = et[i].innerText; tmp.innerHTML = et[i].innerText;
et[i].innerText = tmp.textContent; et[i].innerText = tmp.textContent;
} catch (e) { } catch (e) {
// if not parsable, display as text
console.error(e); console.error(e);
console.log(et[i].innerText); console.log(et[i].innerText);
} }