From 73a01bdcafbc37e20f82a3f769299a1f69b2c209 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Sun, 29 Jan 2017 14:48:23 +0100 Subject: [PATCH] Release 2.28.0 --- CHANGELOG.md | 4 ++++ index.js | 7 +++++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a5cd7..1aca568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Change History ============== +v2.28.0 +--- +* Backport 3.x void tag for plugin authors + v2.27.1 --- * Revert 2.25.0 loader resolving diff --git a/index.js b/index.js index 47e6109..40633a6 100644 --- a/index.js +++ b/index.js @@ -594,9 +594,12 @@ HtmlWebpackPlugin.prototype.createHtmlTag = function (tagDefinition) { } return attributeName + '="' + tagDefinition.attributes[attributeName] + '"'; }); - return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (tagDefinition.selfClosingTag ? '/' : '') + '>' + + // Backport of 3.x void tag definition + var voidTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag : !tagDefinition.closeTag; + var selfClosingTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag && this.options.xhtml : tagDefinition.selfClosingTag; + return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (selfClosingTag ? '/' : '') + '>' + (tagDefinition.innerHTML || '') + - (tagDefinition.closeTag ? '' : ''); + (voidTag ? '' : ''); }; /** diff --git a/package.json b/package.json index 416cac8..f6c5b41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "html-webpack-plugin", - "version": "2.27.1", + "version": "2.28.0", "description": "Simplifies creation of HTML files to serve your webpack bundles", "main": "index.js", "files": [