Skip to content

Commit 73a01bd

Browse files
committed
Release 2.28.0
1 parent 9bdb618 commit 73a01bd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Change History
22
==============
33

4+
v2.28.0
5+
---
6+
* Backport 3.x void tag for plugin authors
7+
48
v2.27.1
59
---
610
* Revert 2.25.0 loader resolving

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,12 @@ HtmlWebpackPlugin.prototype.createHtmlTag = function (tagDefinition) {
594594
}
595595
return attributeName + '="' + tagDefinition.attributes[attributeName] + '"';
596596
});
597-
return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (tagDefinition.selfClosingTag ? '/' : '') + '>' +
597+
// Backport of 3.x void tag definition
598+
var voidTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag : !tagDefinition.closeTag;
599+
var selfClosingTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag && this.options.xhtml : tagDefinition.selfClosingTag;
600+
return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (selfClosingTag ? '/' : '') + '>' +
598601
(tagDefinition.innerHTML || '') +
599-
(tagDefinition.closeTag ? '</' + tagDefinition.tagName + '>' : '');
602+
(voidTag ? '' : '</' + tagDefinition.tagName + '>');
600603
};
601604

602605
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-webpack-plugin",
3-
"version": "2.27.1",
3+
"version": "2.28.0",
44
"description": "Simplifies creation of HTML files to serve your webpack bundles",
55
"main": "index.js",
66
"files": [

0 commit comments

Comments
 (0)