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


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