RocketChat / RocketChat/Rocket.Chat

Wrong display of hyperlinks when an underscore is present in the text

Open
#41,725 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

The display of hyperlinks containing an underscore in the text and in the url is not correct in particular cases.

Steps to reproduce:

In any channel, type the following texts:

[testwithatextcontainingan_here](http://example.com?a_param)

✅ Good display

[test-with-a-text-containing-an_here](http://example.com)

✅ Good display

[test-with-a-text-containing-an_here](http://example.com?param=my_value)

❎ Wrong display

In tried to escape the underscores but this do not improve the display.

Expected behavior:

Correct display of an hyperlink, showing only the text with the underscore.

Actual behavior:
Image
Server Setup Information:
  • Version of Rocket.Chat Server: 8.7.0
  • License Type: starter
  • Operating System:
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: N/A
  • NodeJS Version: v22.22.3
  • MongoDB Version: 8.0.23 / wiredTiger
Client Setup Information
  • Desktop App or Browser Version: 4.15.3
  • Operating System: Ubuntu 24.04.4

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 by reproducing the three Markdown hyperlink examples in any channel and trace the client-side hyperlink rendering path. Add a regression test covering underscores in both link text and a query parameter, then verify the rendered link shows only the intended text without formatting artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.