Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL texts in RC message link previews are not shown right #20333

Open
astromasoud opened this issue Jan 23, 2021 · 3 comments
Open

RTL texts in RC message link previews are not shown right #20333

astromasoud opened this issue Jan 23, 2021 · 3 comments

Comments

@astromasoud
Copy link

Description:

In order to share a message from a chat to another one we should "Get Link" to that message and then paste it in the destination room which would show a preview of the message that the link refers to. It works but when the referred-to message is written in a Right-to-Left (RTL) language and also contains words from LTR-languages in the middle, the sentence structure breaks and is displayed in in a LTR format. I think the link preview shows texts in LTR format by default.

Steps to reproduce:

  1. Write a message in a RTL language and add some Latin words in the middle; for example:
این یک نمونه مثال از یک message است.
(Translates to "this is an example of a message sample" in Persian)

  1. From the message menu click on Get Link.
  2. Paste the Link in another room/channel/chat.

Expected behavior:

The message should be shown like this:

این یک نمونه مثال از یک message است.

Actual behavior:

It's shown in LTR format:

این یک نمونه مثال از یک message است.

Server Setup Information:

  • CentOS 7.9.2009
  • Docker version 20.10.2
  • Version of Rocket.Chat Server 3.10.4

Client Setup Information

The only ones I had access to are these:

  • Chrome web browser on Windows 10
  • Rocket.Chat Windows client version 3.1.1

The Android app Does Not have this issue and works as expected.
I don't have access to Mac/iOS/Linux/... clients to test.

Additional context

Maybe using <div dir="auto"> in the codes could help? I guess it decides based on the beginning character of the paragraph to whether show it in LTR or RTL.

@kasraJ
Copy link

kasraJ commented Jul 27, 2022

We have the same problem and noticed that dir=auto is missing for the "message-body" class in channels & DMs. Although threads don't have this issue and dir=auto exist.
I can confirm that this issue exists in the 4.8.1 version and does not exist in 3.7.7
image

@kasraJ
Copy link

kasraJ commented May 22, 2023

Now in version 6.2 this issue also occurs in threads. This issue is so annoying. I will appreciate if someone sends a PR for resolving this issue.

@mahdi-sheibak
Copy link

PR: RocketChat/fuselage#1059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants