Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags not closed in generated SVG #18

Closed
czebe opened this issue May 20, 2014 · 3 comments
Closed

Tags not closed in generated SVG #18

czebe opened this issue May 20, 2014 · 3 comments

Comments

@czebe
Copy link

czebe commented May 20, 2014

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(?)

@czebe
Copy link
Author

czebe commented May 20, 2014

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();

FWeinb added a commit that referenced this issue May 20, 2014
Always add `xmlns` namespace. Added `options.includedemo`. Fixed Issues
[#20](#20),
[#19](#19),
[#18](#18)
@FWeinb
Copy link
Owner

FWeinb commented May 20, 2014

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

@FWeinb FWeinb closed this as completed May 20, 2014
@czebe
Copy link
Author

czebe commented May 21, 2014

Thanks for fixing this!

jefmatle2v added a commit to jefmatle2v/FWeinbu that referenced this issue Nov 27, 2021
Always add `xmlns` namespace. Added `options.includedemo`. Fixed Issues
[#20](FWeinb/grunt-svgstore#20),
[#19](FWeinb/grunt-svgstore#19),
[#18](FWeinb/grunt-svgstore#18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants