Last modified: 2014-11-20 09:19:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30708, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28708 - BiDi: LTR and RTL mixed up (tracking)
BiDi: LTR and RTL mixed up (tracking)
Status: NEW
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n, patch, patch-need-review, testme, tracking
Depends on: 12225 23035 26665 28411 30630 45941 64617 70117 71661 4050 12079 12151 12406 12415 17766 23893 27206 28030 28349 28758 30919 30977 38474 41036 45932 52684 53795
Blocks: rtl tracking
  Show dependency treegraph
 
Reported: 2011-04-26 14:37 UTC by Jan Paul Posma
Modified: 2014-11-20 09:19 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Bidi fixing effort (5.06 KB, patch)
2011-04-26 14:47 UTC, Jan Paul Posma
Details
Problem with applying this to all links (17.88 KB, image/png)
2011-04-26 15:28 UTC, Jan Paul Posma
Details

Description Jan Paul Posma 2011-04-26 14:37:00 UTC
Tracking bug for all problems where mixing LTR and RTL text causes weird renderings.
Comment 1 Amir E. Aharoni 2011-04-26 14:43:55 UTC
Added Blocks Bug 745 for easier structure and less bugspam.
Comment 2 Jan Paul Posma 2011-04-26 14:47:17 UTC
Created attachment 8463 [details]
Bidi fixing effort

This patch supplies some fixes and shows how this can be used to fix many more BiDi bugs.

By wrapping text in <span class="unicode-embed"></span> a new embedding level is created, which allows for different text direction inside without breaking surrounding text.

This can be done in MediaWiki by using the Sanitizer::safeBiDi() function.

This patch already fixes bug 28030, bug 12415, bug 12406, bug 28411, and bug 28349.
Comment 3 Niklas Laxström 2011-04-26 14:59:30 UTC
a { unicode-bidi: embed } could already fix some things.
Comment 4 Jan Paul Posma 2011-04-26 15:01:57 UTC
No, unfortunately this also breaks a lot, for example pieces of LTR text with links on a RTL wiki. I don't have an example right now but you can try it out for yourself (e.g. set a test-wiki with English texts to language "ar")
Comment 5 Niklas Laxström 2011-04-26 15:17:36 UTC
Please give examples, nobody has complained in twn yet :)
Comment 6 Amir E. Aharoni 2011-04-26 15:23:50 UTC
Niklas, it's quite possible that nobody complained, because RTL at twn was so broken that i switched to English ;)

(And it's really not TWN's fault, but a general problem in MediaWiki.)

I switched to Hebrew now. Where is it used in twn?
Comment 7 Jan Paul Posma 2011-04-26 15:28:12 UTC
Created attachment 8464 [details]
Problem with applying this to all links

When applying this to all links (a { unicode-bidi: embed; }), you get problems when a piece of LTR text in an RTL wiki contains a link. See the screenshot.
Comment 8 Niklas Laxström 2011-04-26 15:33:57 UTC
(In reply to comment #6)
> Niklas, it's quite possible that nobody complained, because RTL at twn was so
> broken that i switched to English ;)
> 
> (And it's really not TWN's fault, but a general problem in MediaWiki.)

I know it's horrible :/

> I switched to Hebrew now. Where is it used in twn?

Everywhere :)

(In reply to comment #7)
> Created attachment 8464 [details]
> Problem with applying this to all links
> 
> When applying this to all links (a { unicode-bidi: embed; }), you get problems
> when a piece of LTR text in an RTL wiki contains a link. See the screenshot.

Well, you're not supposed to have LTR text in RTL wiki (unless tagged as such).
Comment 9 Amir E. Aharoni 2011-04-26 15:39:01 UTC
It's easy to tag LTR text in an RTL wiki when it's a part of an article. It's next to impossible to tag names of pages and users as having different directionality: HTML and CSS cannot be applied to specific names and LRM/RLM characters are filtered out, too.

For usernames filtering out LRM/RLM is probably a Good Thing, because they are supposed to be as simple as possible. But for page titles it is sometimes needed (Bug 28411). I tried solving it using unicode-bidi: embed and failed, but maybe i didn't try hard enough.
Comment 10 Jan Paul Posma 2011-04-26 15:39:50 UTC
Well, that is the entire point of this bug: to fix occurrences of LTR text in an RTL wiki and vice versa. Setting unicode-bidi: embed; to all links doesn't make it better, it makes it worse. Or am I missing something?
Comment 11 Niklas Laxström 2011-04-26 15:44:46 UTC
The fix for that is very easy <div lang=en dir=ltr>..</div>. Like Amir said problem are different kind of listings which can contain mixed directionality items.
Comment 12 Jan Paul Posma 2011-04-26 15:47:39 UTC
(In reply to comment #11)
> The fix for that is very easy <div lang=en dir=ltr>..</div>. Like Amir said
> problem are different kind of listings which can contain mixed directionality
> items.

Okay, so should we then include

a { unicode-bidi: embed; }

in shared.css? What do you think?
Comment 13 Jan Paul Posma 2011-04-26 16:03:54 UTC
This would indeed mean that many things would be fixed automatically, although we would still need to manually wrap using safeBiDi() for bugs that have nothing to do with links, such as bug 12415. 

If you guys as i18n experts say its safe to apply unicode-bidi: embed; to all links by default, then we should do it. ;)

Another option would be to by default have Linker::link add class="unicode-embed" and add a parameter to remove this class.
Comment 14 Niklas Laxström 2011-04-26 19:21:26 UTC
I'm not 100% sure a{embed} it works without issues, otherwise I would have already applied it.
Comment 15 Jan Paul Posma 2011-04-26 19:37:44 UTC
(In reply to comment #14)
> I'm not 100% sure a{embed} it works without issues, otherwise I would have
> already applied it.

I guess we can try it out on a RTL wiki by asking an admin to add the rule to the wiki CSS?
Comment 16 p858snake 2011-04-30 00:08:55 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links