如何修复带数字的双向文本?

How to fix bidirectional text with numbers?

我收到了这段文字,我需要让其中的数字按照数字应有的方式呈现。

我尝试了几种方法来解决它,使用 dir="auto/rtl/ltr" 也在 css 选择器中使用 unicode-bidi,但没有解决它。

一种可能的解决方法是将 phone 数字(和类似文本)包装到一个单独的容器中,并在其上设置 dir="ltr"。例如:

<span>אחד שני <span dir="ltr">+1(617) 522-22-33</span> אחד שני </span>

根据内容的类型,您可以使用本示例中的通用 <span> 或更具体的元素。