In right-to-left language(like Arabic and Hebrew),bracket reversed
You don't need to wrap the bracketed text in a separate span.
Rather, to fix this problem add a RLM control character (‏
) after the closing bracket. The RLM character acts as another Hebrew/Arabic character and so the bracket ( which is a weak character) changes its direction and moves to its correct place.
Like so:
<div>מחיר אחד(3)‏</div>
NB: If you set the attribute dir="rtl"
on the element - then even the RLM control character is unnecessary.
Like so:
<div dir="rtl">מחיר אחד(3)</div>
CODEPEN (jsFiddle down by me)
This microsoft doc explains the RLM control character along with other similar control characters.
(updated: thank you rob for clarifying your comment)
this is a little less invasive solution (result in jsFiddle):
<span lang="he" dir="rtl">מחיר אחד<span>(3)</span></span>
It seems the last parentheses is concidered as punctuation and thus treated differently. This article gave me some clarity:
... Note that unlike align="right", the punctuation will also relocated... See Sample RTL Document
In the sample document the same relocation of the last parentheses also occurs within the subtitle "Bidirectional Override (BDO)".
*checked the jsfiddle solution in latest chrome/ff/safari/ie