Skip to content

Commit

Permalink
allow empty string in meta (#2027)
Browse files Browse the repository at this point in the history
fixes #1714
  • Loading branch information
hiroppy authored and DeMoorJasper committed Sep 18, 2018
1 parent 51b5b34 commit 74fe47b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/parcel-bundler/src/assets/HTMLAsset.js
Expand Up @@ -137,7 +137,12 @@ class HTMLAsset extends Asset {
if (
!Object.keys(node.attrs).some(attr => {
let values = META[attr];
return values && values.includes(node.attrs[attr]);

return (
values &&
values.includes(node.attrs[attr]) &&
node.attrs.content !== ''
);
})
) {
return node;
Expand Down
6 changes: 6 additions & 0 deletions packages/core/parcel-bundler/test/integration/html/index.html
@@ -1,9 +1,14 @@
<!doctype html>
<html>

<head>
<link rel="stylesheet" href="index.css" />
<meta property="og:image" content="100x100.png" />

<!-- fixes https://github.com/parcel-bundler/parcel/issues/1714 -->
<meta name="twitter:image" content="" />
</head>

<body>
<h1>Hello world</h1>
<p>Linking to <a href="other.html">another page</a></p>
Expand All @@ -15,4 +20,5 @@ <h1>Hello world</h1>
<i>hello</i> <i>world</i>
<svg><use href="icons.svg#icon-repo-pull"></use></svg>
</body>

</html>

0 comments on commit 74fe47b

Please sign in to comment.