Closed BrinaryG closed 6 years ago
Hi @BinaryG awesome stuff! Where did you get the list of elements. Just wondering how to best keep it updated
Hi @Havunen
I pulled the list from MDN
using this in the console:
$('.index code').toArray().map(c => c.innerText.replace('<','').replace('>','')).reduce( (acc, c) => { acc.push(c); return acc; },[]).map(c =>
${c}: VNodeFlags.SvgElement).join(',\n')
I then filtered out any conflicts with HTML elements from here
using this in the console:
$('[data-default-state="open"] code').toArray().map(c => c.innerText.replace('<','').replace('>',''))
which left me with 6 elements that are both HTML and SVG tag names:
["a", "font", "image", "script", "style", "title"]
I am not sure this is the best way to handle this so I removed them from the VNodeTypes list maybe it would be better to pass a flag through the transpiler if we are inside an "svg" element and flag all children as such, this would obviously be a bigger change but may be more robust, let me know if this is the direction you would like to go and I will try to dedicate some time to it.
Let me know if anything I have done is incorrect as this is my first PR :)
Thanks
Those extra elements should be handled in Inferno, it passes down isSVG
property so I think its fine.
Yeah, this PR looks good to me. Lets merge it! Thanks for your contribution @BrinaryG !
50