josa42 / atom-svg-preview

Live SVG preview for Atom editor
MIT License
51 stars 14 forks source link

Using an xml namespace prefix for svg elements breaks preview #39

Closed Commod0re closed 6 years ago

Commod0re commented 8 years ago

Adding a namespace prefix to the tags causes svg-preview to display nothing.

For example, this is blank in the preview:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg">
    <svg:svg width="256" height="32">
        <svg:rect x="0" y="0" width="256" height="32" fill="#ffffff" stroke="#000000"/>
    </svg:svg>
</shape>

Removing the svg namespace prefix makes it work without any other changes, so this works:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg">
    <svg width="256" height="32">
        <rect x="0" y="0" width="256" height="32" fill="#ffffff" stroke="#000000"/>
    </svg>
</shape>