Currently, we're using JavaScript's DOMParser API to extract information from the SVG file. We should make sure the APIs that we use are namespace-aware and properly handle namespace.
For example, in the code, we're specifically looking for nodeName API value of g (to find <g> elements). If we use namespace and declare the element as <svg:g> will the code be able to handle it?
This MDN doc might be useful for learning more about namespaces.
Currently, we're using JavaScript's
DOMParser
API to extract information from the SVG file. We should make sure the APIs that we use are namespace-aware and properly handle namespace.For example, in the code, we're specifically looking for
nodeName
API value ofg
(to find<g>
elements). If we use namespace and declare the element as<svg:g>
will the code be able to handle it?This MDN doc might be useful for learning more about namespaces.