Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow empty string in meta #2027

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/assets/HTMLAsset.js
Original file line number Diff line number Diff line change
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 test/integration/html/index.html
Original file line number Diff line number Diff line change
@@ -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>