Skip to content

Commit

Permalink
support svg <use> elements (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdanyow authored and devongovett committed Jan 29, 2018
1 parent d7098ce commit f9be820
Show file tree
Hide file tree
Showing 4 changed files with 13 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 @@ -20,7 +20,8 @@ const ATTRS = {
'embed'
],
href: ['link', 'a'],
poster: ['video']
poster: ['video'],
'xlink:href': ['use']
};

class HTMLAsset extends Asset {
Expand Down
5 changes: 5 additions & 0 deletions test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ describe('html', function() {
name: 'index.html',
assets: ['index.html'],
childBundles: [
{
type: 'svg',
assets: ['icons.svg'],
childBundles: []
},
{
type: 'css',
assets: ['index.css'],
Expand Down
5 changes: 5 additions & 0 deletions test/integration/html/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/integration/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ <h1>Hello world</h1>
<script src="index.js"></script>
<script src="https://unpkg.com/parcel-bundler"></script>
<i>hello</i> <i>world</i>
<svg><use xlink:href="icons.svg#icon-repo-pull"></use></svg>
</body>
</html>

0 comments on commit f9be820

Please sign in to comment.