malinajs 0.7.19 → 0.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/malina.js +1 -1
  2. package/package.json +1 -1
  3. package/runtime.js +6 -3
package/malina.js CHANGED
@@ -6907,7 +6907,7 @@
6907
6907
  });
6908
6908
  }
6909
6909
 
6910
- const version = '0.7.19';
6910
+ const version = '0.7.20';
6911
6911
 
6912
6912
 
6913
6913
  async function compile(source, config = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "malinajs",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "build": "npm run build_runtime && rollup -c",
package/runtime.js CHANGED
@@ -270,9 +270,12 @@ function svgToFragment(content) {
270
270
  let t = document.createElement('template');
271
271
  t.innerHTML = '<svg>' + content + '</svg>';
272
272
 
273
- let result = document.createDocumentFragment();
274
- let svg = t.content.firstChild;
275
- while(svg.firstChild) result.appendChild(svg.firstChild);
273
+ let result, svg = t.content.firstChild;
274
+ if (svg.firstChild == svg.lastChild) result = svg.firstChild;
275
+ else {
276
+ result = document.createDocumentFragment();
277
+ while(svg.firstChild) result.appendChild(svg.firstChild);
278
+ }
276
279
  templatecacheSvg[content] = result.cloneNode(true);
277
280
  return result;
278
281
  }