Re: Weird bidi behavior?

Martin Duerst wrote:
Do you (or anybody else) have any idea why the algorithm is
designed this way? Was this aspect overlooked? Are there other
considerations that justify this behavior? Would it be too
difficult to describe an algorithm that exhibited the above
preservation property? Is this case too rare in practice to
be relevant?
<end of quote>

It is not easy to figure retroactively why the algorithm was designed that 
way.  I guess that the assumption was that authors are not supposed to 
introduce superfluous marking, so if a span specifies dir=ltr while the 
current direction is already ltr, this must signify something tangible 
like raising the embedding level.

Achieving what you want would be easy: add an LRM before and after the 
span, to avoid interaction with possible adjacent RTL text (and for RTL 
paragraph direction with <span dir="rtl">, add RLM before and after the 
span to avoid interaction with possible adjacent LTR text).

In most real life cases, omitting the LRMs or RLMs would not be critical 
since the span is not likely to be directly adjacent to opposite-direction 
text.  In most cases, there should be an intervening space or punctuation, 
and this would be enough to prevent the above-mentioned interaction.

Shalom (Regards),  Mati
           Bidi Architect
           Globalization Center Of Competency - Bidirectional Scripts
           IBM Israel
           Phone: +972 2 5888802    Fax: +972 2 5870333    Mobile: +972 52 

Received on Thursday, 28 August 2008 12:34:23 UTC