Display RTL (right-to-left) text properly #1021
Labels
No labels
accessibility
bug
bug
infrastructure
Codeberg
contributions welcome
docs
duplicate
enhancement
infrastructure
legal
licence / ToS
please chill
we are volunteers
public relations
question
question
user support
s/Forgejo
s/Forgejo/migration
s/Pages
s/Weblate
s/Woodpecker
security
service
upstream
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Community#1021
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If a markdown text is in a Right-to-Left language (Farsi, Arabic, etc), Codeberge doesn't show it in proper way. Instead, it shows it Left-to-Right.
Also the same thing is true for textboxes (Like the one that I'm righting in)!
I attach the screenshots to see how it's now and how it should be.
❌ Wrong (Codeberg)

✅ Correct (Github)

Any link to such a sample file?
Yes. @silverwind
This is the file on Codeberg:
https://codeberg.org/mokazemi/Linux-notes-and-cheatsheet/src/branch/main/Set-Persian-Font-Globally.md
And this is the same file on Github:
https://github.com/mokazemi/Linux-notes-and-cheatsheet/blob/main/Set-Persian-Font-Globally.md
To display bidirectional texts properly, the best way is to add
dir="auto"to every element. and in CSS, should usestartandendinstead ofleftandright. for example:text-align: start;. and similar things for margins, padding and...Not exactly.
This doesn't work on nested elements (for example
liinsideul)Looking at how GitHub does it, they do appear to indeed add
dir=autoto many elements. There are CSS properties likedirection, but apparently those do not have aautovalue.WIP at https://github.com/go-gitea/gitea/pull/24816, I added the
dir=auto, but it does nothing. Not sure what else is needed. Feedback welcome on how to get it to work.I did a lot of experiments on Codeberg and Github and I guess finally found the problem.
The thing is, somewhere on Codeberg css you are setting
text-align: left;which causes the text direction to be RTL, but the align is still LTR.That
.ui.tableselector is selecting the grandparent div of markdown text.Removing that
text-align: left;or addingtext-align: initial;to the child(s) solves the issue.Thanks, I figured that out as well. It's a short-sighted style coming from the Fomantic UI framework, which we now override to
text-align: startand then it works. https://github.com/go-gitea/gitea/pull/24816 will merge momentarily.This seems to have been fixed. Huge thanks @silverwind! Closing...