@litejs/dom 26.4.1 → 26.4.2

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 (2) hide show
  1. package/dom.js +3 -2
  2. package/package.json +1 -1
package/dom.js CHANGED
@@ -464,9 +464,10 @@ extendNode(HTMLElement, Element, {
464
464
  var attrs = this.attributes.toString(minify)
465
465
  , isXml = this.ownerDocument.contentType === "application/xml"
466
466
  , voidEl = this.ownerDocument.documentElement.tagName === "svg" ? svgVoidElements : voidElements
467
- return "<" + this.localName +
467
+ , content = voidEl[this.tagName] ? null : Node.toString.call(this, minify)
468
+ return minify && this.tagName === "STYLE" && !content.trim() ? "" : "<" + this.localName +
468
469
  (attrs ? " " + (attrs.slice(-1) === "/" ? attrs + " " : attrs) : "") +
469
- (voidEl[this.tagName] ? (isXml ? "/>" : ">") : ">" + Node.toString.call(this, minify) + "</" + this.localName + ">")
470
+ (voidEl[this.tagName] ? (isXml ? "/>" : ">") : ">" + content + "</" + this.localName + ">")
470
471
  }
471
472
  })
472
473
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litejs/dom",
3
- "version": "26.4.1",
3
+ "version": "26.4.2",
4
4
  "description": "A small DOM library for server-side testing, rendering, and handling of HTML files",
5
5
  "license": "MIT",
6
6
  "author": "Lauri Rooden <lauri@rooden.ee>",