Skip to content

Commit

Permalink
Add xmlns:xlink in reusePaths plugin (svg#1555)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored Sep 3, 2021
1 parent 1e5236d commit fab4b25
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions plugins/reusePaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ exports.fn = () => {
}
}
if (defsTag.children.length !== 0) {
if (node.attributes['xmlns:xlink'] == null) {
node.attributes['xmlns:xlink'] = 'http://www.w3.org/1999/xlink';
}
node.children.unshift(defsTag);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/reusePaths.01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/plugins/reusePaths.02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/plugins/reusePaths.03.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fab4b25

Please sign in to comment.