RocketChat / RocketChat/Rocket.Chat
The target="_blank" in <a> elements inside a link preview are missing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
The anchor elements inside the link content preview sections of a link are missing the target="_blank" attribute,

The quote element (link's content preview)
<blockquote class="twitter-tweet">
<p lang="en" dir="ltr"> I always wondered what I should get a tattoo of, now I don't have to wonder any more <a href="https://t.co/9UqGSs0OcO">pic.twitter.com/9UqGSs0OcO</a>
</p>— Jeff Atwood (@codinghorror) <a href="https://twitter.com/codinghorror/status/1467258675307814914?ref_src=twsrc%5Etfw">December 4, 2021</a>
</blockquote>
Steps to reproduce:
1- Copy a link (Such as a link to a tweet)
2- Paste it into a conversation's message box, and send it
3- Click on a link from inside that link's preview section (as highlighted above)
Expected behavior:
The link must open in a separate tab since it's a link to an external source.
Actual behavior:
The link opens up in the same tab as Rocket chat. This is more of an issue in Rocketchat's desktop client since there's no back button in the desktop version. Whereas you can just click the back button, and go back to the page that you were on before (RC)
What happens in the Desktop client:

Server Setup Information:
Irrelevant.
Client Setup Information
- Desktop App or Browser Version: Desktop: latest, Browser: Chrome 96
- Operating System: Windows 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by reproducing the link preview behavior in the browser or desktop client, then trace the link-preview rendering path. Done means links inside external previews open in a separate tab without replacing the Rocket.Chat view.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop-dev, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100