Page MenuHomePhabricator

BiDI: please preserve dir="ltr" and dir="rtl" in TOC
Closed, InvalidPublic


Author: gangleri

URL will follow


<span dir="ltr" >Welcome!</span>

will generate the following TOC at a RTL type wiki:


Please compare the titles in the TOC and the section names!‬

  1. ‪the first is OK, "!" is at right end‬
  2. ‪the second is wrong; "!" should be at right end

regards reinhardt [[user:gangleri]]

Version: unspecified
Severity: trivial



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:57 PM
bzimport set Reference to bz4039.
bzimport added a subscriber: Unknown Object (MLST).

gangleri wrote:

*** Bug 2405 has been marked as a duplicate of this bug. ***

gangleri wrote:

changed the subject

If you look at the generated code of the TOC at
[[wiktionary:yi:project:bugzilla/04039]] you will see:

<table id='toc' class='toc'>
<div id='toctitle'>
<li class='toclevel-1'><a href="#follow_the_links"><span
class="tocnumber">1</span> <span class="toctext">follow the links</span></a></li>
<li class='toclevel-1'><a href="#.E2.80.AAHello.21.E2.80.AC"><span
class="tocnumber">2</span> <span class="toctext">‪Hello!‬</span></a></li>

<li class='toclevel-1'><a href="#Welcome.21"><span class="tocnumber">3</span>
<span class="toctext">Welcome!</span></a></li>

the *actual* <span class="toctext">Welcome!</span> should preserve dir="ltr"
from the section title which is

<span dir="ltr" >Welcome!</span>

Preserving dir="ltr" and dir="rtl" in TOC would be a much better solution as
using general punctuation characters.
See them at

best regards reinhardt [[user:gangleri]]

... huh?

Closing INVALID, reopen if you can explain in comprehensible English.

gangleri wrote:


If you want to write a message to a contributor at [[ar:]], [[ur:]] and you know
that this contributor does not understand the content language (because he takes
care of InterLanguage links etc.) you probably will write in English.

These wiki's are RTL.

If you make a new section *typing*


the build in BiDi mechanism of the browser will generate somthing that *looks*
like *!Welcome* both in the TOC and as the header of the section.

I tried varios variants:
a) *typing*


which *displayes* both in the TOC and as the header of that section as *Welcome!*
This is a kind of workaround but is ugly.

b) I tried using general punctuation characters *typing*


Opticaly this is fine but the anchor contains the general punctuation characters:
This solution is not suitable.

c) I tried

<span dir="ltr" >Welcome!</span>

Now the header of the section generates fine but what you *see* as header is
and is *not* the same as what is in the TOC

The request for this bug report.
What is generated at this moment for c) is

<li class='toclevel-1'><a href="#Welcome.21"><span class="tocnumber">3</span>
<span class="toctext">Welcome!</span></a></li>

You see that both *<span dir="ltr" >* and *</span>* is "filtered".

What should be generated is

<li class='toclevel-1'><a href="#Welcome.21"><span class="tocnumber">3</span>
<span class="toctext"><span dir="ltr" >Welcome!</span></span></a></li>

I mean that *toctext* should preserve whatever was in the header. Please do
*not* concatenate / do not use <span class="toctext" dir="ltr" > because other
examples could use nested span dir="foo".

best regards reinhardt [[user:gangleri]]

gangleri wrote:

you will experience
Bug 4987: The "autocomment" link differs from the TOC link if <font ... /> or
<font ...> ... </font> is used.

This is not a MediaWiki bug, but a part of a family of feature requests to make true BiDi editing easier. Currently it can be solved by inserting LRMs in the right places. Common people don't like it, but there's nothing better.

The right thing to do to solve this on talk pages is to have ace RTL support on LiquidThreads (Bug 20934).