Skip to content

Commit

Permalink
handle titles with html entities as html titles (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed Jul 3, 2023
1 parent 94c35d9 commit b9f80de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Expand Down
4 changes: 3 additions & 1 deletion rsspreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@
//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 '&'
//(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');
try {
tmp.innerHTML = et[i].innerText;
et[i].innerText = tmp.textContent;
} catch (e) {
// if not parsable, display as text
console.error(e);
console.log(et[i].innerText);
}
Expand Down

0 comments on commit b9f80de

Please sign in to comment.