Commit bcef73d2 authored by Philipp Nowinski's avatar Philipp Nowinski

[BUGFIX] remove log and fix failing test

parent a8cb58b0
...@@ -58,7 +58,7 @@ module.exports = function (_options) { ...@@ -58,7 +58,7 @@ module.exports = function (_options) {
// parse the svg and extract dimensions // parse the svg and extract dimensions
xml2js.parseString(String(file.contents), {strict: false, attrkey:'ATTR', attrNameProcessors:[attrToLowerCase]}, function (err, result) { xml2js.parseString(String(file.contents), {strict: false, attrkey:'ATTR', attrNameProcessors:[attrToLowerCase]}, function (err, result) {
if (err) throw err; if (err) throw err;
var hasWidthHeightAttr = result.SVG.ATTR['width'] && result.SVG.ATTR['height'], var hasWidthHeightAttr = result.SVG.ATTR['width'] && result.SVG.ATTR['height'],
width, width,
height; height;
...@@ -73,7 +73,6 @@ module.exports = function (_options) { ...@@ -73,7 +73,6 @@ module.exports = function (_options) {
var iteration = 0; var iteration = 0;
var inlineSvg = encodeURIComponent(String(file.contents)).replace(new RegExp('(stroke|fill+)%3D%22%23?((?:.(?!%23?\s+(?:\S+)%3D|[%3E%22]))+.)%22?', 'gim'), function(match, p1, p2) { var inlineSvg = encodeURIComponent(String(file.contents)).replace(new RegExp('(stroke|fill+)%3D%22%23?((?:.(?!%23?\s+(?:\S+)%3D|[%3E%22]))+.)%22?', 'gim'), function(match, p1, p2) {
console.log('p2', p2);
return p1 + '%3D%22%23#{color' + ++iteration + '}%22'; return p1 + '%3D%22%23#{color' + ++iteration + '}%22';
}); });
......
{ {
"name": "gulp-inline-svg", "name": "gulp-inline-svg",
"version": "1.0.1", "version": "1.0.2",
"description": "A gulp plugin to use inline SVG as background-images", "description": "A gulp plugin to use inline SVG as background-images",
"keywords": [ "keywords": [
"gulpplugin, gulp, svg, inline" "gulpplugin, gulp, svg, inline"
......
$test: 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22350.471%22%20height%3D%22350.471%22%3E%3Cg%20stroke%3D%22%230091d4%22%20stroke-width%3D%221.9%22%3E%3Cpath%20d%3D%22M.95.95h234.286v225.714H.95z%22%2F%3E%3Cpath%20d%3D%22M349.52%20236.664c0%2062.33-50.526%20112.857-112.856%20112.857-62.33%200-112.857-50.526-112.857-112.856%200-62.33%2050.528-112.857%20112.857-112.857%2062.33%200%20112.857%2050.528%20112.857%20112.857z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A' 350px 350px; $test: 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22350.471%22%20height%3D%22350.471%22%3E%3Cg%20stroke%3D%22%23#{color1}%22%20stroke-width%3D%221.9%22%3E%3Cpath%20d%3D%22M.95.95h234.286v225.714H.95z%22%2F%3E%3Cpath%20d%3D%22M349.52%20236.664c0%2062.33-50.526%20112.857-112.856%20112.857-62.33%200-112.857-50.526-112.857-112.856%200-62.33%2050.528-112.857%20112.857-112.857%2062.33%200%20112.857%2050.528%20112.857%20112.857z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A' 350px 350px;
@mixin inline-svg($name) { @mixin inline-svg($name) {
background: transparent url(nth($name, 1)) no-repeat 50% 50%; background: transparent url(nth($name, 1)) no-repeat 50% 50%;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment