SVG tags' shapes lose their closing tags
See original GitHub issuevar cheerio = require('cheerio');
var $ = cheerio.load('<svg><symbol><circle></circle></symbol><g><rect></rect></g><path></path></svg>');
console.log($.html());
//=> '<svg><symbol><circle></symbol><g><rect></g><path></svg>'
Using 0.17.0, <circle>
, <rect>
, and <path>
lose their closing tags.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to avoid HTML1500 Tag cannot be self-closing warning ...
A lot of svg-elements can arguably be self-closing. However, these same elements (including basic shapes) often support animation elements, ...
Read more >How to Simplify SVG Code Using Basic Shapes - CSS-Tricks
This is the code for the “close” or “cross” icon that was downloaded from flaticon.com and built by pixel-perfect:.
Read more >Tag Shapes Svg - Etsy
Check out our tag shapes svg selection for the very best in unique or custom, handmade pieces from our papercraft shops.
Read more >5 Most Common Problems Faced by SVG Users - Vecta.io
1. Missing fonts · A. Wrongly declared font name · B. You're using <img> or background image to embed your SVG · C....
Read more >Do you need closing tags with SVGs? - Quora
SVG is based on XML (and a DTD), so all tags need to be closed ! It can reside within a page written...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
They are self-closing in SVG, so your document should still render properly. If you’re working with an XML document, try passing the
xmlMode
option.Thank you for the fix #673. It’s ok for most of the tags (path, line, polyline…) excepted <polygon> which is not closed, and break the svg.