Skip to content

Commit

Permalink
Merge pull request #96 from matthewnessworthy/xlink
Browse files Browse the repository at this point in the history
Include xmlns:xlink in <svg/> definition
  • Loading branch information
w0rm authored Dec 21, 2018
2 parents 391c9d3 + 67177ed commit 6187097
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
var inlineSvg = config.inlineSvg || false
var ids = {}

var resultSvg = '<svg xmlns="http://www.w3.org/2000/svg"><defs/></svg>'
var resultSvg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs/></svg>'
if (!inlineSvg) {
resultSvg =
'<?xml version="1.0" encoding="UTF-8"?>' +
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"sinon": "^1.16.1",
"wd": "^0.4.0"
},
"engines" : { "node" : ">=4.0" },
"engines": {
"node": ">=4.0"
},
"engineStrict": true,
"keywords": [
"gulpplugin",
Expand Down
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('gulp-svgstore unit test', function () {
stream.on('data', function (file) {
var result = file.contents.toString()
var target =
'<svg xmlns="http://www.w3.org/2000/svg">' +
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
'<symbol id="circle" viewBox="0 0 4 4" preserveAspectRatio="xMinYMid meet"><circle cx="2" cy="2" r="1"/></symbol>' +
'<symbol id="square"><rect x="1" y="1" width="2" height="2"/></symbol>' +
'</svg>'
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('gulp-svgstore unit test', function () {
stream.on('data', function (file) {
var result = file.contents.toString()
var target =
'<svg xmlns="http://www.w3.org/2000/svg">' +
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
'<symbol id="circle" viewBox="0 0 4 4"><circle cx="2" cy="2" r="1"/></symbol>' +
'</svg>'
assert.equal( result, target )
Expand Down Expand Up @@ -182,7 +182,7 @@ describe('gulp-svgstore unit test', function () {
stream.on('data', function(file){
var result = file.contents.toString()
var target =
'<svg xmlns="http://www.w3.org/2000/svg">' +
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
'<defs><circle id="circ" cx="2" cy="2" r="1"/></defs>' +
'<symbol id="circle" viewBox="0 0 4 4"/>' +
'</svg>'
Expand Down

0 comments on commit 6187097

Please sign in to comment.