Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/165750

Change subject: Don't crash when the page title is RTL.
......................................................................

Don't crash when the page title is RTL.

The \setRTL command was being output before the LaTeX header.  Adding
`dirBreak` and `envBreak` at the appropriate places ensures that
directionality commands are appropriately grouped.

Change-Id: I3a7eaee6ce216f4bd7254ced55061a64591082c0
---
M lib/index.js
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
 refs/changes/50/165750/1

diff --git a/lib/index.js b/lib/index.js
index a3ffe17..158c60c 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1734,18 +1734,22 @@
                dir: collectionPoly.dir
        });
        headFormat.setCoverage(collectionPoly);
-       headFormat.writeDecorated(head + '\n');
+       headFormat.writeDecorated(head);
+       headFormat.envBreak();
        // emit title, subtitle, etc.
        var title = metabook.title;
        headFormat.writeDecorated('\\hypersetup{pdftitle={'+texEscape(title, 
'nourls')+'}}\n');
        headFormat.writeDecorated('\\title{{\\Huge ');
+       headFormat.dirBreak();
        headFormat.write(title);
        headFormat.writeDecorated('}');
        if (metabook.subtitle) {
                headFormat.lineBreak();
                headFormat.write(metabook.subtitle);
        }
-       headFormat.writeDecorated('}\n');
+       headFormat.dirBreak();
+       headFormat.writeDecorated('}');
+       headFormat.envBreak();
        // start the doc!
        headFormat.writeDecorated('\\begin{document}\\maketitle\n');
        if (toc) {

-- 
To view, visit https://gerrit.wikimedia.org/r/165750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a7eaee6ce216f4bd7254ced55061a64591082c0
Gerrit-PatchSet: 1
Gerrit-Project: 
mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to