Skip to content

Commit

Permalink
fix-dependency-tag-with-empty-value (#2553)
Browse files Browse the repository at this point in the history
Solves #2528
  • Loading branch information
abdullahtariq1171 authored and DeMoorJasper committed Feb 9, 2019
1 parent f23c844 commit 01174eb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/core/parcel-bundler/src/assets/HTMLAsset.js
Expand Up @@ -168,18 +168,25 @@ class HTMLAsset extends Asset {
}

for (let attr in node.attrs) {
let elements = ATTRS[attr];
const attrVal = node.attrs[attr];

if (!attrVal) {
continue;
}

// Check for virtual paths
if (node.tag === 'a' && node.attrs[attr].lastIndexOf('.') < 1) {
if (node.tag === 'a' && attrVal.lastIndexOf('.') < 1) {
continue;
}

let elements = ATTRS[attr];

if (elements && elements.includes(node.tag)) {
let depHandler = this.getAttrDepHandler(attr);
let options = OPTIONS[node.tag];
node.attrs[attr] = depHandler.call(
this,
node.attrs[attr],
attrVal,
options && options[attr]
);
this.isAstDirty = true;
Expand Down

0 comments on commit 01174eb

Please sign in to comment.