Page MenuHomePhabricator

PDF export extension problem with <div dir="ltr"> and <div dir="rtl">
Closed, InvalidPublic

Description

PDF export extension doesn't support <div direction="ltr;"> (in LTR wikis) or <div direction="rtl;"> (in LTR wikis)

http://en.wikipedia.org/wiki/User:Reza1615/test


Version: unspecified
Severity: normal

Details

Reference
bz30667

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:51 PM
bzimport added a project: Collection.
bzimport set Reference to bz30667.
bzimport added a subscriber: Unknown Object (MLST).

There is no HTML attribute "direction"; do you mean "dir"?

The ";" seems extra/broken as well in your examples.

(The PDF rendered still may or may not actually pay any attention.)

The test page does snow pdf export not respecting <div dir="rtl">

volker.haas wrote:

Fixed with https://github.com/pediapress/mwlib.rl/commit/b4d5d2219e1414f2b6be26b2a51ed6e9b88d5180

The following four cases are handled correct. If there are more ways to indicate a direction switch in html/css let me know

<div dir="ltr;">
text. this does actually not switch anything. the semicolon is responsible for breaking this.
</div>

<div dir="ltr">
text
</div>

<div style="direction:ltr;">
text
</div>

<div style="direction:ltr">
text
</div>

(In reply to comment #3)

Fixed with
https://github.com/pediapress/mwlib.rl/commit/b4d5d2219e1414f2b6be26b2a51ed6e9b88d5180

The following four cases are handled correct. If there are more ways to
indicate a direction switch in html/css let me know

<div dir="ltr;">
text. this does actually not switch anything. the semicolon is responsible for
breaking this.
</div>

<div dir="ltr">
text
</div>

<div style="direction:ltr;">
text
</div>

<div style="direction:ltr">
text
</div>

it doesn't work in fa.wiki
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf2

in rtl wikis when we wright Latin word inside text we have to use <span style="direction:ltr; unicode-bidi:embed;"></span> for correcting () and other symbols place is it possible to correct it?

for example:
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf

<span style="direction:ltr; unicode-bidi:embed;">.com</span>

(In reply to comment #6)

Fixed with
https://github.com/pediapress/mwlib.rl/commit/c458cab76b383e66ac9d2ab617d7bc0c98a7044e

I'll update the render servers later today

in this case it doesn't work in fawiki we have many cases that are like this
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf3#direction

Created attachment 11197
screen shot

Attached:

screeen_shot02.jpg (876×1 px, 128 KB)

Using "دریافت به‌صورت PDF" (errm, Firefox fails to properly copy the order of these words...) on https://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/pdf3#direction , everything is aligned to the right. :(

Pppery closed this task as Invalid.EditedNov 5 2023, 7:12 PM
Pppery subscribed.

Closing as obsolete - PDF export from Collection has been dead for years. I can't reproduce with the current PDF renderer.