From 814045a141faf6f7aafe3f5a4b66193bf25852b7 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 23 Aug 2016 11:08:55 -0400 Subject: [PATCH] Make NativeMML output only set attributes when they are not the default (just like toMathML). --- unpacked/jax/output/NativeMML/jax.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index 6936f2e98..1427c4861 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -518,8 +518,10 @@ skip = MML.skipAttributes, copy = MML.copyAttributes; if (!this.attrNames) { for (var id in defaults) {if (!skip[id] && !copy[id] && defaults.hasOwnProperty(id)) { - if (this[id] != null && this[id] !== defaults[id]) - tag.setAttribute(id,this.NativeMMLattribute(this[id])); + if (this[id] != null && this[id] !== defaults[id]) { + if (this.Get(id,null,1) !== this[id]) + tag.setAttribute(id,this.NativeMMLattribute(this[id])); + } }} } for (var i = 0, m = names.length; i < m; i++) {