Commit 4df2eefd authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix buffer/string conversions

parent 9dad1050
......@@ -45,7 +45,7 @@ module.exports = class InlineSvg {
});
svgs.forEach(svg => this._processSvg(svg))
let template = mustache.render(
templateContent,
templateContent.toString(),
_.extend(
{},
this._options.context,
......@@ -102,8 +102,8 @@ module.exports = class InlineSvg {
width = parseInt(xmlString.svg.$['width']);
height = parseInt(xmlString.svg.$['height']);
} else {
width = parseInt(result.svg.$['viewbox'].toString().replace(/^\d+\s\d+\s(\d+\.?[\d])\s(\d+\.?[\d])/, "$1"));
height = parseInt(result.svg.$['viewbox'].toString().replace(/^\d+\s\d+\s(\d+\.?[\d])\s(\d+\.?[\d])/, "$2"));
width = parseInt(xmlString.svg.$['viewbox'].toString().replace(/^\d+\s\d+\s(\d+\.?[\d])\s(\d+\.?[\d])/, "$1"));
height = parseInt(xmlString.svg.$['viewbox'].toString().replace(/^\d+\s\d+\s(\d+\.?[\d])\s(\d+\.?[\d])/, "$2"));
}
return {
width,
......@@ -138,7 +138,7 @@ module.exports = class InlineSvg {
* @returns {String}
*/
_getTemplateContent() {
return fs.readFileSync(this._options.template, 'utf-8');
return fs.readFileSync(this._options.template);
}
};
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