This is a very good question, as it relates to one of several unresolved problems in using traditional (‘Square Hebrew’) text in computer environments:
Mixing RTL (right-to-left) text such as Hebrew or Arabic with LTR text such as English usually wreaks havoc on the display order of the text. One reason is the conflict between two competing standards of encoding in Hebrew—Logical, and Visual:
The bi-directional way (logical method) and the visual method. In the logical method characters are stored in the electronic document in the order that a normal person would type, and in the visual method the characters are ordered assuming that the display device will order them left-to-right. In HTML, only the logical method is a real standard.