RocketChat / RocketChat/Rocket.Chat

URL href values in search results are rendered with <mark> tag

Open
#22,877 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When searching for link in channel, rendered href value has <mark> tags.

Steps to reproduce:
  1. Send message "https://test.com"
  2. Search for message "test"
  3. Click on link in search window
Expected behavior:

Rocketchat should redirect to https://test.com

Actual behavior:

Rocketchat redirects to https://<mark>test</mark>.com

Server Setup Information:
  • Version of Rocket.Chat Server: 3.17.0
  • Operating System: CentOS Linux
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.22.1
  • MongoDB Version: 3.6.21
Client Setup Information
  • Desktop App or Browser Version: Firefox 89.0.2
  • Operating System: Ubuntu Linux
Additional context

Bug is in file Rocket.Chat/app/ui-message/client/message.js on line 47. I was able to fix it in place by removing <mark> and </mark> strings, but with this, we lost searched result highlight. In docker image, it's in file /app/bundle/programs/web.browser/66eaa3be98974e118b931b4c4ec6172ce4ec8f05.js. There is still open pull request with proposed fix by @TBG-FR in #20878.

Relevant logs:

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Rocket.Chat/app/ui-message/client/message.js line 47 and review the proposed fix in pull request #20878. Reproduce the search-link case using the steps in the issue, then verify that the href remains https://test.com while search-result highlighting is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.