Skip to content

Bi-directional text rendering issues in translated version of book #1413

@moaminsharifi

Description

@moaminsharifi

There are a number of issues with the rendering of bi-directional text in RTL languages. These issues can cause text to be displayed incorrectly, making it difficult or impossible to read.

Some of the most common issues include:

  • Text being displayed in the wrong order, from left to right instead of right to left.
  • Text being displayed overlapping.
  • Text being displayed with incorrect spacing.
  • Text being displayed with incorrect kerning.

Issue description

As an example, when you compile the latest version of the repo in Persian, this is your first page like that:
Welcome to Comprehensive Rust 🦀 - Comprehensive Rust 🦀 - issue in BiDi

It seems right for someone who doesn't know RTl languages; however, if you are learning in your native language, it can be confusing.
Welcome to Comprehensive Rust 🦀 - Comprehensive Rust 🦀 - issue in BiDi - highlight it

this is how must be rendered in RTl languages:

Welcome to Comprehensive Rust 🦀 - Comprehensive Rust 🦀 - fix issue in BiDi

Proposed solving way for Solving Bi-directional issue

Why not directly fix in mdbook?

My first step was to check out the Contributing to MDBook document before I started a github issue here

The current PR backlog is beyond what we can process at this time. Only issues that have an E-Help-wanted or Feature accepted label will likely receive reviews.
mdBook/CONTRIBUTING.md
As far as I can tell, supporting BiDi is not a priority for them at the moment

My Proposed method:

The way I fix the bi-di issue with the html tags is to add dir="auto" html attribute just after rendering by js and add "unicode-bidi:embed;" to those classes.

Refrences:
#671
mdBook issue#1486 Support for Right to Left

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions