Page MenuHomePhabricator

On RTL wikis, content of <source> is shown as RTL direction but should be LTR
Closed, ResolvedPublic

Event Timeline

Yamaha5 created this task.Jul 10 2015, 2:51 PM
Yamaha5 raised the priority of this task from to High.
Yamaha5 updated the task description. (Show Details)
Yamaha5 added a subscriber: Yamaha5.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2015, 2:51 PM
Aklapper renamed this task from At Rtl wikis Source tag direction should be ltr to On RTL wikis, content of <source> is shown as RTL direction but should be LTR.Jul 10 2015, 2:56 PM
Aklapper added projects: I18n, MediaWiki-Parser.
Aklapper set Security to None.
Aklapper added a project: RTL.
Aklapper added a subscriber: Amire80.

@Yamaha5: Thanks. Did this work correctly before (if yes, when?) / is this a regression?

I am not even sure what does <source> do these days and whether it is supposed to be still valid, but changing <source> to <syntaxhighlight> and adding a closing </syntaxhighlight> tag shows it correctly from left to right.

It's conceivable to leave this bug open to fix <source>, but it begs the question - is <source> tag support needed any longer in 2015?

Eh, sorry, this is caused by 043969f84eb5c61a508c05bf5ffd369cc6655cd6. For the record, there's no difference between <source> and <syntaxhighlight>, purging the page would have also fixed it.

The issue is:

  • Originally we couldn't set dir="ltr" on the container for the highlighted code (because Pygments isn't flexible enough to allow it), and so we did direction: ltr; in CSS (8593fef342cbda8d278f360bc5cf68740815ebb8).
  • Then we worked around Pygments it so that we can set dir="ltr" (and we do now), and therefore removed direction: ltr; (043969f84eb5c61a508c05bf5ffd369cc6655cd6). But now we have cached HTML without the dir="ltr" on the wikis, and without direction: ltr; in CSS either.

Basically we should undo this part of the change:,cm (and a few weeks later redo it, when it's no longer needed) – but since it's Saturday and the fix won't be deployed now, you can alternatively add .mw-highlight { /*@noflip*/ direction: ltr; } in MediaWiki:Common.css on the affected wikis (and remove it a few weeks later).

Change 224230 had a related patch set uploaded (by Bartosz Dziewoński):
Restore 'direction: ltr;' for .mw-highlight

Change 224230 merged by jenkins-bot:
Restore 'direction: ltr;' for .mw-highlight

matmarex closed this task as Resolved.Jul 15 2015, 12:58 PM
matmarex removed a project: Patch-For-Review.

This will be deployed to the wikis this week (tomorrow or Thursday, depending on the wiki).