commit 463c88e4be69872cee464a90c3522153230e13c2
parent cbdfa18ad16df52d561d2229edcb5c45cf97380c
Author: Davide P. Cervone <dpvc@union.edu>
Date: Tue, 25 Aug 2015 15:14:48 -0400
Don't use monospace for MS, and use smart quotes, like CommonHTML.
Diffstat:
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/unpacked/jax/output/HTML-CSS/autoload/ms.js b/unpacked/jax/output/HTML-CSS/autoload/ms.js
@@ -32,16 +32,19 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
MML.ms.Augment({
toHTML: function (span) {
span = this.HTMLhandleSize(this.HTMLcreateSpan(span));
- var values = this.getValues("lquote","rquote");
- var text = this.data.join(""); // FIXME: handle mglyph?
- this.HTMLhandleVariant(span,this.HTMLgetVariant(),values.lquote+text+values.rquote);
+ var values = this.getValues("lquote","rquote","mathvariant");
+ if (!this.hasValue("lquote") || values.lquote === '"') values.lquote = "\u201C";
+ if (!this.hasValue("rquote") || values.rquote === '"') values.rquote = "\u201D";
+ if (values.lquote === "\u201C" && values.mathvariant === "monospace") values.lquote = '"';
+ if (values.rquote === "\u201D" && values.mathvariant === "monospace") values.rquote = '"';
+ var text = values.lquote+this.data.join("")+values.rquote; // FIXME: handle mglyph?
+ this.HTMLhandleVariant(span,this.HTMLgetVariant(),text);
this.HTMLhandleSpace(span);
this.HTMLhandleColor(span);
this.HTMLhandleDir(span);
return span;
}
});
- MML.ms.prototype.defaults.mathvariant = 'monospace';
MathJax.Hub.Startup.signal.Post("HTML-CSS ms Ready");
MathJax.Ajax.loadComplete(HTMLCSS.autoloadDir+"/ms.js");
diff --git a/unpacked/jax/output/SVG/autoload/ms.js b/unpacked/jax/output/SVG/autoload/ms.js
@@ -33,17 +33,20 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
toSVG: function () {
this.SVGgetStyles();
var svg = this.SVG(); this.SVGhandleSpace(svg);
- var values = this.getValues("lquote","rquote");
+ var values = this.getValues("lquote","rquote","mathvariant");
+ if (!this.hasValue("lquote") || values.lquote === '"') values.lquote = "\u201C";
+ if (!this.hasValue("rquote") || values.rquote === '"') values.rquote = "\u201D";
+ if (values.lquote === "\u201C" && values.mathvariant === "monospace") values.lquote = '"';
+ if (values.rquote === "\u201D" && values.mathvariant === "monospace") values.rquote = '"';
var variant = this.SVGgetVariant(), scale = this.SVGgetScale();
- var text = this.data.join(""); // FIXME: handle mglyph?
- svg.Add(this.SVGhandleVariant(variant,scale,values.lquote+text+values.rquote));
+ var text = values.lquote+this.data.join("")+values.rquote; // FIXME: handle mglyph?
+ svg.Add(this.SVGhandleVariant(variant,scale,text));
svg.Clean();
this.SVGhandleColor(svg);
this.SVGsaveData(svg);
return svg;
}
});
- MML.ms.prototype.defaults.mathvariant = 'monospace';
MathJax.Hub.Startup.signal.Post("SVG ms Ready");
MathJax.Ajax.loadComplete(SVG.autoloadDir+"/ms.js");