Skip to content

Commit

Permalink
pass strip:false to the template engine
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Sep 15, 2015
1 parent 8272499 commit c70b6c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return function(style) {
SVGCache.init(options);
return style.eachDecl(/^background|^filter|^content|image$/, function(decl) {
var ___, error, matches, name, params, replace, svg;
var ___, error, error1, matches, name, params, replace, svg;
if (!decl.value) {
return;
}
Expand All @@ -34,8 +34,8 @@
}
try {
svg = SVGCache.get(name);
} catch (_error) {
error = _error;
} catch (error1) {
error = error1;
if (silent) {
console.info("postcss-svg: " + error);
} else {
Expand Down
8 changes: 5 additions & 3 deletions dist/lib/svg_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
})(this));
this._checkSVG(doc);
doc = new xmldom.XMLSerializer().serializeToString(doc);
return this.template = doT.template(doc);
return this.template = doT.template(doc, _.extend(doT.templateSettings, {
strip: false
}));
};

SVGImage.prototype._checkSVG = function(doc) {
Expand Down Expand Up @@ -205,7 +207,7 @@
};

SVGImage.prototype._addColor = function(type, attributes, node) {
var base, color, key, selectors, typeSelector;
var base, color, error, key, selectors, typeSelector;
try {
color = attributes[type].value === 'none' ? Color('rgba(255, 255, 255, 0)') : Color(attributes[type].value);
typeSelector = "[" + type + "]";
Expand Down Expand Up @@ -233,7 +235,7 @@
return "it[\'" + selector + "\']";
});
return node.attributes[attributes[type].index].value = "{{= " + (selectors.join(' || ')) + " || \'" + attributes[type].value + "\'}}";
} catch (_error) {
} catch (error) {

}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/svg_image.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SVGImage
@_checkSVG(doc)
doc = new xmldom.XMLSerializer().serializeToString(doc)

@template = doT.template(doc)
@template = doT.template(doc, _.extend(doT.templateSettings, { strip: false }))

_checkSVG: (doc) ->
if !(Object.keys(@colors).length > 0)
Expand Down

0 comments on commit c70b6c4

Please sign in to comment.