From 2d02ade498a7c42a7aa7a0dd676be13bf9b994de Mon Sep 17 00:00:00 2001 From: poire-z Date: Thu, 23 Jan 2020 17:43:48 +0100 Subject: [PATCH] Footnote popups: drop justification if RTL content MuPDF does not handle "text-align: justify" correctly on RTL text: the last line is left-aligned, but it should be right-aligned. Not using justify makes it correctly right align the whole text. --- frontend/ui/widget/footnotewidget.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/ui/widget/footnotewidget.lua b/frontend/ui/widget/footnotewidget.lua index 0c77972a4..edc8dfa4f 100644 --- a/frontend/ui/widget/footnotewidget.lua +++ b/frontend/ui/widget/footnotewidget.lua @@ -81,6 +81,11 @@ a { color: black; } /* MuPDF: color: #06C; */ * Wikipedia EPUBs, each footnote is a LI */ body > li { list-style-type: none; } +/* MuPDF always aligns the last line to the left when text-align: justify, + * which is wrong with RTL. So cancel justification on RTL elements: they + * will be correctly aligned to the right */ +*[dir=rtl] { text-align: initial; } + /* Remove any (possibly multiple) backlinks in Wikipedia EPUBs footnotes */ .noprint { display: none; } ]]