Skip to content

Commit

Permalink
Fix quoted content checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
EltonChou committed Sep 17, 2023
1 parent ebaae09 commit 8ca4ad7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content_script/utils/article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ const articleHasVideo = (article: HTMLElement): boolean => {
const isBelongsToCard = (ele: HTMLElement): boolean =>
Boolean(ele?.closest('[data-testid="card.wrapper"]'))
const isVideoInQuotedContent = (ele: HTMLElement) =>
Boolean(ele?.closest('[role="link"]'))
Boolean(ele?.closest('[role="link"]')?.querySelector('time'))
const isPhotoInQuotedContent = (ele: HTMLElement) =>
Boolean(ele?.closest('[id^="id"]:not([aria-labelledby])'))
Boolean(ele?.closest('[id^="id"]:not([aria-labelledby])')?.querySelector('time'))

export const articleHasMedia = (article: HTMLElement) =>
article && (articleHasVideo(article) || aricleHasPhoto(article))
Expand Down

0 comments on commit 8ca4ad7

Please sign in to comment.