How to fix bidirectional text with numbers?

Viewed 188

I got this text and I need to make the number inside of it to be rendered as a number should.

enter image description here

I tried several ways to solve it using dir="auto/rtl/ltr" also using unicode-bidi in a css selector and nothing fixed it.

1 Answers

One possible way around is wrapping the phone number (and similar text) into a separate container with dir="ltr" set on it. For example:

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

Depending on content's type, you can use either generic <span> as in this example, or more specific element.

Related