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

createNodesFromMarkup Returns Invalid linearGradient or radialGradient Nodes #103

Closed
mgreystone opened this issue Jan 12, 2016 · 1 comment

Comments

@mgreystone
Copy link

I am afraid the createNodesFromMarkup module does not properly handle a linearGradient & radialGradient nodes, or presumably any element whose tag has capital letters. getNodeName always converts the tag name to lowercase, so the node adopts incorrectly adopts the XHTML namespace.

Here is a working demonstration with React. Notice that the circle's gradient fill is not working after the component is updated.

And here is a bare-bones example:

import createNodesFromMarkup from 'fbjs/lib/createNodesFromMarkup'

const markup = '<linearGradient id="foo"></linearGradient>'
const result = createNodesFromMarkup(markup)
const node = result[0]

console.log(node.tagName) // 'LINEARGRADIENT', should be 'linearGradient'
console.log(node.localName) // 'lineargradient', should be 'linearGradient'
console.log(node.namespaceURI) // 'http://www.w3.org/1999/xhtml', should be 'http://www.w3.org/2000/svg'

Thank you for your time.

@sophiebits
Copy link
Contributor

This is already fixed in React master (by not using getMarkupWrap) and will be in v15.

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