Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have I found a bug in Web rendering engines?

Tags:

html

utf-8

I have a web page with a fragment of hebrew in a page of english text.

I would expect to be able to write something like:

"You are looking for *מכון ויצמן למדע*, which is called *Weizmann Institute of Science* in english"

however I'm not seeing that when the hebrew is rendered in an HTML list-item.

The actual html is:

<ul><li><a href="">מכון ויצמן למדע</a> (113)</li></ul>

which renders thus:

  • מכון ויצמן למדע (113)

(this is probably reading "* 113) xxxx xxxx xxx)" )

Why?

(I've tried Safari, Chrome, Chromium, and IE - all are doing it)

Sub-note:

Playing within Web Developer.... adding a letter (ASCII or UTF-8) before the opening brace seems to untangle it:

<ul>
    <li><a href="">מכון ויצמן למדע</a> a(113)</li>
    <li><a href="">מכון ויצמן למדע</a> ม(113)</li>
</ul>

renders as:

  • מכון ויצמן למדע a(113)
  • מכון ויצמן למדע ม(113)
like image 461
CodeGorilla Avatar asked Dec 09 '25 05:12

CodeGorilla


1 Answers

Use dir=ltr to link.

<ul><li><a href="" dir=ltr>מכון ויצמן למדע</a> (113)</li></ul> 
                   ^^

http://jsfiddle.net/yo66rwo9/

Or solution without dir attribute, just using CSS:

<ul><li><a href="">מכון ויצמן למדע</a> (113)</li></ul>
<style>
    * {direction: ltr; unicode-bidi: embed;}
</style>

http://jsfiddle.net/yo66rwo9/2/

I don't know why, the behavior is so strange, but it helps.
I try to find any reason why it works, later I'll update my post.

like image 133
pavel Avatar answered Dec 12 '25 04:12

pavel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!