
Read AI Markdown in Right-to-Left Languages
Arabic, Hebrew, and Farsi AI output deserves a reader that respects script direction. Here is why most markdown tools break bidi text, and what to fix.
Arabic, Hebrew, and Farsi speakers get a strange experience when they open a long AI answer. The prose flips the wrong way. Code blocks still read left to right, but the paragraph around them pretends to be English. Lists bullet from the wrong edge. Punctuation lands on the wrong side of a word. It looks sloppy because the tools rendering the markdown were never built for bidirectional text.
If you work in two scripts at once, this matters a lot. A translator checking a Claude draft needs the Arabic to orient correctly while the source English stays legible. A developer in Tel Aviv pairing with ChatGPT wants Hebrew comments next to JavaScript variables without the parentheses flipping. A journalist in Cairo pulling research notes from Gemini needs Arabic prose to sit next to quoted English sources cleanly. All of them deserve a reader that respects script direction. Prism MD treats bidirectional text as a first-class concern, not an afterthought wedged in near the end of a changelog.
Why RTL breaks in most markdown readers
Most markdown libraries assume one direction per document. They set dir="ltr" on the root, then let the browser guess the rest. For pure Arabic that is usually fine. For mixed content it falls apart quickly. A sentence that starts with Hebrew and ends with a function name in English will render with the function name floating in the wrong position, sometimes with its parentheses mirrored to look nonsensical.
Pasted AI output makes this worse. Models generate markdown as a stream of tokens, and they interleave scripts freely. One sentence might carry four scripts. The reader has to switch direction mid-line without the writer labeling anything. Browsers can do this with the Unicode Bidirectional Algorithm, but only when the container tells them to try. If you want to see what proper bidi looks like in a spec setting, the W3C article on bidi is still the clearest reference.
What a good RTL reader does
A reader that handles AI output in Arabic or Hebrew needs five things working together. None of them are optional, because missing one causes the whole page to feel off even when the others are correct. The failures compound: a wrong bullet position next to a mirrored parenthesis next to a European numeral in Arabic prose produces something close to unreadable. Here is the minimum spine every bidi-aware reader has to meet:
dir="auto"on every block, so each paragraph decides its own direction based on its first strong character.- Logical CSS properties, so padding and margins flip with the text instead of staying pinned to the left edge.
- Code blocks locked to left-to-right regardless of context, because programming languages are not bidirectional.
- Lists that pick a side based on the surrounding script, with bullets and numbers mirrored accordingly.
- Numerals rendered with the correct digit shape for the locale, whether European or Arabic-Indic.
Prism MD handles all five by default. Paste a Hebrew response from Claude and the paragraphs orient themselves. Paste an Arabic answer with a Python snippet inside and the code block stays readable while the prose flows the other way. Headings align to the right edge in RTL blocks and the left edge in LTR blocks within the same document. For the typography side of the equation, we wrote a longer piece on AI markdown typography that covers the font fallback stack we use for Noto Naskh Arabic and Noto Sans Hebrew.
Mixed-script pitfalls to watch for
Three things trip up even careful readers. The first is quoted punctuation. A quoted phrase inside an Arabic sentence should carry Arabic quotation marks, but models often emit straight ASCII quotes. The second is numerals. European numerals read fine in Arabic prose, but Arabic-Indic digits are also valid, and some users expect them. The third is the direction of list bullets, which should mirror automatically but often does not when a markdown renderer forces its own direction.
If you want to stress-test any reader, try pasting a Claude answer that mixes a Hebrew paragraph, an English bullet list, and a block of SQL. Then try a long Arabic response that contains three KaTeX equations. Most readers mangle at least one of those three cases. For math specifically, our guide to rendering math and mermaid explains why KaTeX blocks stay LTR even inside RTL prose.
Reading on mobile matters more here
Arabic and Hebrew readers skew more mobile than English speakers do. If your markdown reader only works well on a 15-inch laptop screen, you lose most of the audience. Prism MD was designed mobile-first with a reading pane that respects script direction on phones, tablets, foldables, and e-readers. Line length adjusts for Arabic ligatures, which run wider than Latin glyphs at the same point size. Our note on reading AI answers offline on a long flight covers how the local cache handles RTL text without extra configuration.
Pull your most recent Gemini or ChatGPT conversation into Prism MD and watch what happens. The Arabic paragraphs face right. The English code faces left. The headings line up to the correct edge. Lists carry the right bullet placement. Nothing you had to configure, nothing you had to toggle, nothing you had to patch after the fact.
FAQ
Does Prism MD support Farsi and Urdu as well as Arabic and Hebrew?
Yes, every major RTL script is supported. Any script tagged as RTL in the Unicode Bidirectional Algorithm is handled the same way. Farsi, Urdu, Pashto, Dari, Sindhi, and Kurdish Sorani all work. Mixed content with Latin, Cyrillic, or CJK scripts flows correctly inside each block. We rely on the browser engine for the heavy lifting, which means the rendering tracks whatever the latest Unicode release defines.
What about Arabic-Indic numerals in my AI responses?
The reader respects whichever digit shape the AI generated. If you want to override to European numerals for consistency across a document, you can set a per-document preference in the sidebar. We do not auto-convert digits by default, because converting across number systems can change the meaning of citations, phone numbers, and dated references. A hadith reference or a legal citation can shift meaning if the digits get swapped silently.
Will right-to-left mode affect my code blocks?
No, code blocks are untouched. Code blocks are locked to left-to-right regardless of the surrounding paragraph direction. Line numbers stay on the left, syntax highlighting runs its normal direction, and copy-to-clipboard preserves the original byte order. This matches how every major IDE renders source code, so your pasted output round-trips cleanly back into VS Code or JetBrains without hidden control characters.
Does the reader handle vertical scripts like Mongolian or traditional Chinese?
Not yet, but the roadmap includes it. The current build covers horizontal RTL only. Vertical scripts need a separate layout engine with different scroll mechanics and different line-break rules. We have that on the roadmap for a future release, and the groundwork for logical properties already pushes us partway there. If you have a specific use case for vertical scripts, let us know what AI tools you want to read from.
Read your Arabic and Hebrew AI chats the right way.
Free to start — no credit card.
Related reading
Ready to read your own AI documents?
Open ChatGPT, Claude, Gemini, or any markdown file in the reader built for the way models write.
- ✓Renders code, math & Mermaid out of the box
- ✓Works offline once you've opened a doc
- ✓Free forever for personal reading


