FWeinb/grunt-svgstore

Tags not closed in generated SVG

czebe opened this issue · 3 comments

If I have only one <path> element as the only child of SVG root, the generated svg will have <path d="..." id="..."> but no closing tag or trailing slash. I guess this is due to how cheerio handles non-html tags(?)

Apparently you can use cheerio to output valid XML by calling .xml() instead of html().
This fixes the issue:
var result = options.formatting ? beautify($resultDocument.xml(), options.formatting) : $resultDocument.xml();

Thanks for investigation. This error was caused by breaking changes in cheerio.

Thanks for fixing this!