Skip to content

Commit

Permalink
fix #359
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed May 9, 2020
1 parent 23e1591 commit 35d9a9d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ function getStylesData($, options) {
styleElement = this;
styleDataList = styleElement.childNodes;
if (styleDataList.length !== 1) {
if (options.removeStyleTags) {
$(styleElement).remove();
}
return;
}
styleData = styleDataList[0].data;
Expand Down
Empty file.
6 changes: 6 additions & 0 deletions test/cases/juice-content/empty-style-tag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head>
<style></style>
</head>
<body></body>
</html>
3 changes: 3 additions & 0 deletions test/cases/juice-content/empty-style-tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"removeStyleTags": true
}
6 changes: 6 additions & 0 deletions test/cases/juice-content/empty-style-tag.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<head>

</head>
<body></body>
</html>

0 comments on commit 35d9a9d

Please sign in to comment.