Repository navigation
Show Arabic and Hebrew replies right-to-left while code and paths stay left-to-right - #1996
Conversation
#1939) Text blocks take dir=auto; lists, quotes and tables resolve first-strong direction skipping code; inline code, fences, path links and bare URLs stay left-to-right. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3d5ba79ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (node.tagName === "code" || node.tagName === "pre") return "auto"; | ||
| for (const child of node.children ?? []) { | ||
| const dir = blockDir(child); | ||
| if (dir !== "auto") return dir; |
There was a problem hiding this comment.
Skip isolated bare URLs when determining container direction
For Arabic or Hebrew content beginning with a bare URL, such as > https://example.com ثم راجع التعليمات, blockDir descends into the link and returns ltr from its URL text. However, MarkdownLink now gives that same link dir="ltr", so the paragraph's browser-driven direction scan skips it and resolves to RTL. This leaves the quote bar on the wrong side; the same issue puts list markers and table columns in LTR order when their first content is a URL followed by RTL prose. Exclude bare-URL anchors from the container scan, consistently with their rendered isolation.
Useful? React with 👍 / 👎.
Agent replies mixing Arabic or Hebrew with English now read in the right direction. Each paragraph, list, quote and table takes its direction from its first real letter, and inline code, code blocks, file paths and bare URLs stay left-to-right. Closes #1939.
Changes
dir="auto").blockDir). The browser rule ignores children that carry their owndir, which left Arabic quotes with the bar on the left and Arabic tables with columns in LTR order.dir="ltr", so they stay intact and don't decide the paragraph's direction. A reply starting with`src/app.ts`followed by Arabic still reads right-to-left.Verification
tsc --noEmitclean,vite buildpasses,npm run test:renderer: 3963 pass, 0 fail. New tests cover direction attributes, code being skipped, liststartand task-list class surviving.dir="auto", so I rendered 9 fixtures (mixed punctuation, inline code and paths, Hebrew with path + URL, English with Arabic/Hebrew words, RTL lists with links, ordered list, blockquote, table, code block) in headless Chromium. All render correctly.Notes for reviewers
claude-opus-5-5 via Claude Code
🤖 Generated with Claude Code