Use less-aggressive CSS for ltr and inline-block, and do Edge check within the extension.

This commit is contained in:
Davide P. Cervone 2015-09-12 13:23:29 -04:00
parent bbdbe19eda
commit e172b04928
2 changed files with 11 additions and 3 deletions

View File

@ -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)),

View File

@ -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");
});