Mobrovac has submitted this change and it was merged.
Change subject: Fix: Set default MathStyle to inlineDisplaystyle
......................................................................
Fix: Set default MathStyle to inlineDisplaystyle
Redo Ibf6bdbd4ea36b4905445d5878f32f7e0b2bc8bac, which was
reverted by I029328849f05ec2afcabf38d2b79b337cb54cbd5.
In addition this patch simplifies the tex sent to the mathoid
server. Instead of {\displaystyle {\textstyle ... } } only
{\textstyle is sent (which overwrites \displaystyle anyway).
Change-Id: I16d6f67215c2f85ecd1d3a0bddacfc1700681557
---
M MathMathML.php
M MathRenderer.php
2 files changed, 5 insertions(+), 6 deletions(-)
Approvals:
Mobrovac: Looks good to me, approved
diff --git a/MathMathML.php b/MathMathML.php
index 0bb18f6..058400e 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -219,6 +219,8 @@
if ( $this->getMathStyle() == 'inlineDisplaystyle' ) {
// default preserve the (broken) layout as it
was
$out = 'type=inline-TeX&q=' . rawurlencode(
'{\\displaystyle ' . $input . '}' );
+ } elseif ($this->getMathStyle() == 'inline' ){
+ $out = 'type=inline-TeX&q=' . rawurlencode(
$input );
} else {
$out = 'type=tex&q=' . rawurlencode( $input );
}
diff --git a/MathRenderer.php b/MathRenderer.php
index 0ae380b..46aeeea 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -67,17 +67,16 @@
if ( isset( $params['id'] ) ) {
$this->id = $params['id'];
}
- $mathStyle = null;
if ( isset( $params['display'] ) ) {
$layoutMode = $params['display'];
if ( $layoutMode == 'block' ) {
- $mathStyle = 'display';
+ $this->mathStyle = 'display';
$tex = '{\displaystyle ' . $tex . '}';
} elseif ( $layoutMode == 'inline' ) {
- $mathStyle = 'inlineDisplaystyle';
+ $this->mathStyle = 'inline';
$tex = '{\textstyle ' . $tex . '}';
} elseif ( $layoutMode == 'linebreak' ) {
- $mathStyle = 'linebreak';
+ $this->mathStyle = 'linebreak';
$tex = '\[ ' . $tex . ' \]';
}
}
@@ -93,8 +92,6 @@
// be centered in a new line, or just in be displayed in the
current line.
$this->userInputTex = $tex;
$this->tex = $tex;
- $this->mathStyle = $mathStyle;
-
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/229349
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I16d6f67215c2f85ecd1d3a0bddacfc1700681557
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits