commit e172b049280b268680fa21b32c6384965f0d67b4
parent bbdbe19eda28f709c1afc9c41813598e933a7d53
Author: Davide P. Cervone <dpvc@union.edu>
Date: Sat, 12 Sep 2015 13:23:29 -0400
Use less-aggressive CSS for ltr and inline-block, and do Edge check within the extension.
Diffstat:
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js
@@ -3090,7 +3090,6 @@ MathJax.Hub.Startup = {
isMac: (navigator.platform.substr(0,3) === "Mac"),
isPC: (navigator.platform.substr(0,3) === "Win"),
isMSIE: ("ActiveXObject" in window && "clipboardData" in window),
- isMsEdge: (!!AGENT.match(/Edge\//)),
isFirefox: (!!AGENT.match(/Gecko\//) && !AGENT.match(/like Gecko/)),
isSafari: (!!AGENT.match(/ (Apple)?WebKit\//) && !AGENT.match(/ like iPhone /) &&
(!window.chrome || window.chrome.loadTimes == null)),
diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js
@@ -80,7 +80,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
*/
var BROWSER = MathJax.Hub.Browser;
var exslt = '';
- if (BROWSER.isMsEdge || BROWSER.isMSIE) {
+ if (!!navigator.userAgent.match(/ Edge\//) || BROWSER.isMSIE) {
exslt = 'urn:schemas-microsoft-com:xslt'
} else {
exslt = 'http://exslt.org/common';
@@ -767,7 +767,16 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
}
// Tweak CSS to avoid some browsers rearranging HTML output
- MathJax.Ajax.Styles(".MathJax span { direction: ltr !important; display: inline-block !important;}");
+ MathJax.Ajax.Styles({
+ ".MathJax .mi, .MathJax .mo, .MathJax .mn, .MathJax .mtext": {
+ direction: "ltr",
+ display: "inline-block"
+ },
+ ".MathJax .ms, .MathJax .mspace, .MathJax .mglyph": {
+ direction: "ltr",
+ display: "inline-block"
+ }
+ });
MathJax.Hub.Startup.signal.Post("MathML mml3.js Ready");
});