From c877e564fc483daf0e65a65bad97618383d63c58 Mon Sep 17 00:00:00 2001 From: Moritz Schubotz Date: Wed, 11 Jan 2017 10:43:10 -0800 Subject: [PATCH] Add scrollbars to displaystyle formulae MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add mwe-math-element class attribute to the outermost element holding mathematical expressions. Add a css rule that adds a scrollbar to the element in case it's a div, which is the case for displaystyle formulae. Note, there will be no scroll bar if long formulae are not explicitly marked up das displaystyle formulae.ƒ Bug: T134281 Change-Id: Iba462601bb15f8667d1284282ba4f6c2020a02b9 --- MathMathML.php | 2 +- modules/ext.math.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/MathMathML.php b/MathMathML.php index 40bc77c..d29210a 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -446,7 +446,7 @@ class MathMathML extends MathRenderer { } else { $element = 'span'; } - $attribs = []; + $attribs = [ 'class' => 'mwe-math-element' ]; if ( $this->getID() !== '' ) { $attribs['id'] = $this->getID(); } diff --git a/modules/ext.math.css b/modules/ext.math.css index 69ea129..7ee2f9b 100644 --- a/modules/ext.math.css +++ b/modules/ext.math.css @@ -57,3 +57,8 @@ generated by Mathoid. See https://gerrit.wikimedia.org/r/#/c/166213/ */ img.tex { vertical-align: middle; } + +.mwe-math-element { + overflow-x: auto; + max-width: 100%; +}