Merge pull request #1511 from dpvc/issue1356

Don't convert attribute to boolean unless the default is a boolean.  #1356
This commit is contained in:
Davide P. Cervone 2016-07-06 13:59:57 -04:00 committed by GitHub
commit d29f299c35

View File

@ -142,8 +142,14 @@
value = this.filterAttribute(name,value);
var defaults = (mml.type === "mstyle" ? MML.math.prototype.defaults : mml.defaults);
if (value != null) {
if (value.toLowerCase() === "true") {value = true}
else if (value.toLowerCase() === "false") {value = false}
var val = value.toLowerCase();
if (val === "true" || val === "false") {
if (typeof (defaults[name]) === "boolean" || defaults[name] === MML.INHERIT ||
(defaults[name] === MML.AUTO &&
(mml.defaultDef == null || typeof(mml.defaultDef[name]) === "boolean"))) {
value = (val === "true");
}
}
if (defaults[name] != null || MML.copyAttributes[name])
{mml[name] = value} else {mml.attr[name] = value}
mml.attrNames.push(name);