Issue with tagName case-sensitivity when creating SVG content.
See original GitHub issueI am using jsdom in paper.js to export SVG content. In order to export gradients, I am using the following command to create a SVG linearGradient node:
document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient')
This results in a tag <lineargradient> in the output, so with a lowercased tagName, which is then not recognized by SVG parsers.
I assume this is a bug in jsdom?
Issue Analytics
- State:
- Created 10 years ago
- Comments:25 (17 by maintainers)
Top Results From Across the Web
Re: Case-Sensitivity & SVG-in-HTML5 - Mailing lists - W3C
SVG elements are not in the HTML namespace and therefor should be case sensitive: """ Element nodes in the HTML namespace whose local...
Read more >JavaScript createElementNS and SVG - Stack Overflow
In particular I have problems creating a element. As it will be appended as <textpath> and thus will not work. I did some...
Read more >John Resig - .nodeName Case Sensitivity
.nodeName Case Sensitivity · The node names of HTML elements are always uppercase, even if they're explicitly created using lowercase characters.
Read more >Using str.replace() to fix clipPath case-sensitivity makes SVG ...
The remaining problem with output2.svg is that the <use> reference in your clip path element wasn't correct. What I did: <clippath> -> <clipPath> ......
Read more >дэн on Twitter: "However, if you're creating SVG with ...
Today I learned how tag case sensitivity works in DOM and SVG. ... You can pass tag with any casing to createElement(). It...
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
A little different. When i set the attribute of svg by setAttribute(‘viewBox’, ‘0 0 1024 1024’), the output is viewbox,it is lowercase and not recoginzed by browers. My jsdom is v14.1.0@Domenic Denicola
This doesn’t seem to be fully fixed unfortunately. The following still produces lowercased tag names: