Bidirectional Text

The dir global attribute (including auto), <bdo>/<bdi>, and the CSS direction/unicode-bidi properties are all driven by a real Unicode Bidirectional Algorithm (UAX #9) implementation - per-character reordering of mixed-direction text, not just mirroring whole words.

Plain right-to-left paragraph (dir="rtl")

שלום עולם! זהו טקסט בעברית, והוא זורם מימין לשמאל.

Mixed-direction text and bracket mirroring

The embedded Latin word and version number stay left-to-right within the surrounding Hebrew paragraph, and the parentheses mirror to match the paragraph's own direction - both resolved per character, not per word.

מספר הגרסה של הספרייה (PeachPDF) הוא 0.9.6.

<bdo>: forcing a direction override

Normal: Hello, World!    Overridden: Hello, World!

<bdi>: isolating unknown-direction content

A right-to-left username embedded directly in a left-to-right sentence can drag the following punctuation/score into the wrong visual position:

<bdi> isolates it, so the score always reads correctly regardless of the username's own direction:

dir="auto": detecting direction from content

שלום, זהו טקסט עם dir="auto" שמתחיל בעברית - מזוהה אוטומטית כטקסט מימין לשמאל.

Hello, this is text with dir="auto" that starts in English - auto-detected as left-to-right.