Skip to content

Commit

Permalink
Merge pull request #571 from alexlamsl/inline-empty-content-whitespace
Browse files Browse the repository at this point in the history
treat empty inline tags as text
  • Loading branch information
alexlamsl committed Mar 21, 2016
2 parents 932cb14 + d90c81f commit bbffbc1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/htmlminifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -1504,14 +1504,16 @@
optionalEndTag = '';
}
else {
// push out everything but the end tag
if (options.includeAutoGeneratedTags || !autoGenerated) {
buffer.push('</' + tag + '>');
}
charsPrevTag = '/' + tag;
if (!inlineTextTags(tag)) {
currentChars = '';
}
else if (isElementEmpty) {
currentChars += '|';
}
}
},
chars: function(text, prevTag, nextTag) {
Expand Down
Loading

0 comments on commit bbffbc1

Please sign in to comment.