diff options
author | Vitaly Takmazov | 2024-03-13 13:18:59 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-03-13 13:18:59 +0300 |
commit | a78b3e51745fb5530d3b45db28abe862376e09ab (patch) | |
tree | b782d1a36a37265c06710de0b07d03e6d049a42a | |
parent | d3eb799ea302b520ef253c53874a6fafe508409e (diff) |
embed.js: do not embed links when media is present
-rw-r--r-- | vnext/src/utils/embed.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js index 4501168b..59290227 100644 --- a/vnext/src/utils/embed.js +++ b/vnext/src/utils/embed.js @@ -395,7 +395,10 @@ export function embedAll() { let beforeNodeSelector = '.msg-txt + *' let allLinksSelector = '.msg-txt a' Array.from(document.querySelectorAll('#content .msg-cont')).forEach(msg => { - embedLinksToX(msg, beforeNodeSelector, allLinksSelector) + let hasMedia = msg.querySelector('.msg-media') || msg.querySelector('.ir') + if (!hasMedia) { + embedLinksToX(msg, beforeNodeSelector, allLinksSelector) + } }) } /** |