Skip to content

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

Description

@juluanb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions