Skip to content

Commit

Permalink
add support for data attr of object element (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnijuohz authored and devongovett committed Mar 28, 2018
1 parent 39e4f7a commit 6e8ae0d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/assets/HTMLAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const ATTRS = {
srcset: ['img', 'source'],
poster: ['video'],
'xlink:href': ['use'],
content: ['meta']
content: ['meta'],
data: ['object']
};

// A list of metadata that should produce a dependency
Expand Down
16 changes: 16 additions & 0 deletions test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,20 @@ describe('html', function() {
]
});
});

it('should support data attribute of object element', async function() {
let b = await bundle(__dirname + '/integration/html-object/index.html');

assertBundleTree(b, {
name: 'index.html',
assets: ['index.html'],
childBundles: [
{
type: 'svg',
assets: ['file.svg'],
childBundles: []
}
]
});
});
});
3 changes: 3 additions & 0 deletions test/integration/html-object/file.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions test/integration/html-object/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html>
<object data="file.svg" type="image/svg+xml"></object>

0 comments on commit 6e8ae0d

Please sign in to comment.