mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle cases where tweet items dont have parents
This commit is contained in:
parent
1e4b499c40
commit
3f82c0af01
1 changed files with 2 additions and 2 deletions
|
|
@ -2231,12 +2231,12 @@ Readability.prototype = {
|
|||
|
||||
// remove all containers the tweet is nested in (if they contain the tweet only)
|
||||
let tweetParent = tweet.parentElement || tweet.parentNode;
|
||||
while (tweetParent && tweetParent.children.length === 1) {
|
||||
while (tweetParent && tweetParent.children.length === 1 && tweetParent.parentNode) {
|
||||
tweetParent.parentNode.replaceChild(tweet, tweetParent);
|
||||
tweetParent = tweet.parentElement || tweet.parentNode;
|
||||
}
|
||||
|
||||
if (tweetParent && tweetParent.className.includes('twitter-tweet')) {
|
||||
if (tweetParent && tweetParent.className.includes('twitter-tweet') && tweetParent.parentNode) {
|
||||
tweetParent.parentNode.replaceChild(tweet, tweetParent);
|
||||
}
|
||||
} else if (element.parentNode && element.parentNode.className === 'tweet') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue