R024: Punctuation rendering at the wrong visual end of Arabic text
An unpaired parenthesis at the start or end of Arabic text usually means strings were joined across a direction change, and in right-to-left rendering it lands at the wrong end.
The check
- Id
- R024
- Category
- Direction and bidi
- Default severity
When it fires
low confidence
Text that is mostly Arabic, at least 10 Arabic letters, starts or ends with a parenthesis, and its parentheses do not pair up. That usually means strings were joined across a change of direction. It is a pattern rather than a measurement, so it reports at low confidence.
Fix: Check how this string is assembled; complete the pair or isolate the embedded run with
<bdi>.
What it leaves alone
Text the scanner only holds part of. The extractor keeps the first 240 characters of an element, and when the rest is cut off a bracket may close later, so the rule stays silent rather than report the cut. Also code blocks, translate="no" and non-Arabic lang contexts.
Broken, then fixed
<p>شحن مجاني لجميع الطلبات (</p><p>شحن مجاني لجميع الطلبات (فوق ٢٠٠ ريال)</p>Check it by hand
Run document.body.innerText.match(/^[()].*\p{Script=Arabic}.*$|^.*\p{Script=Arabic}.*[()]$/gmu) in the DevTools console to list lines of Arabic text that start or end with a bracket. Then find where each string is assembled: a template joining an Arabic label to a value is the usual source.
What the report shows you
Each R024 finding carries the fields below that apply to it, so you can see why it fired without rerunning the scan.
- sample
- The text, cut to 120 characters.
- openParens
- How many opening parentheses it holds.
- closeParens
- How many closing parentheses it holds.
More direction and bidi checks
- Forced-LTR container, or a bidi override, over Arabic content
- Unisolated bidi hazards: phones, emails, Latin tokens inside Arabic text
- text-align: left explicitly set on majority-Arabic text
- Text inputs rendered LTR where Arabic input is expected
- Directional icon pointing against the sequence its control advances
Does your page trip R024?
Paste a URL. Ritla renders the page on desktop, tablet and mobile, runs every check, and shows the top issues with screenshot evidence.
Scan a page freeBrowse the checks