From 70bbd42c9d6d59e923e0c71e5333d24b7be68b13 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 8 Feb 2014 13:02:56 -0500 Subject: [PATCH] Handle nested elements without error. Resolves issue #614. --- unpacked/jax/output/SVG/jax.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 8c2a72a7c..cf9b398a0 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -1929,6 +1929,17 @@ svg.Add(box); svg.Clean(); this.SVGsaveData(svg); // + // If this element is not the top-level math element + // remove the transform and return the svg object + // (issue #614). + // + if (!span) { + svg.element = svg.element.firstChild; // remove element + svg.element.removeAttribute("transform"); + svg.removable = true; + return svg; + } + // // Style the to get the right size and placement // var l = Math.max(-svg.l,0), r = Math.max(svg.r-svg.w,0);