Don't use monospace for MS, and use smart quotes, like CommonHTML.

This commit is contained in:
Davide P. Cervone 2015-08-25 15:14:48 -04:00
parent cbdfa18ad1
commit 463c88e4be
2 changed files with 14 additions and 8 deletions

View File

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

View File

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