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.
dir="rtl")שלום עולם! זהו טקסט בעברית, והוא זורם מימין לשמאל.
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 overrideNormal: Hello, World! Overridden: Hello, World!
<bdi>: isolating unknown-direction contentA 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.