RTL (Right-to-Left) Text Alignment Issue with Table of Contents Component in Farsi

AI-generated summary

serkhelesheyi reported an alignment issue with the Table of Contents (TOC) component in Discourse when using Farsi (Persian), a Right-to-Left (RTL) language. Specifically, the headings in the TOC sidebar lack sufficient padding/margin from the vertical line, making the text appear “stuck” and less readable compared to the English (LTR) display. serkhelesheyi included screenshots demonstrating the problem and requests investigation for a future update. sam acknowledged the report and has added a “pr-welcome” tag, indicating the issue can be addressed by a community contribution.


I’m using the Table of Contents (TOC) component in my Discourse forum, and I’ve noticed an alignment issue when the forum language is set to Farsi (Persian), which is a Right-to-Left (RTL) language.

Problem Description:

When viewing a topic with the TOC component enabled in Farsi, the text of the headings in the TOC sidebar appears to be “stuck” or have zero padding/margin from the vertical line on the right side. This contrasts with the English (Left-to-Right - LTR) display, where there is a noticeable and appropriate left padding/margin from the vertical line.

This lack of spacing makes the Farsi TOC less visually appealing and somewhat harder to read, as the text butts directly against the vertical separator.

Expected Behavior:

Could this be investigated and potentially addressed in a future update? This would greatly improve the user experience for RTL language users.

Thank you for your time and assistance!

1 Like

Thanks for reporting, putting a pr-welcome on this for now :hugs:

1 Like