cssho / vscode-svgviewer

SVG Viewer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=cssho.vscode-svgviewer
MIT License
67 stars 20 forks source link

Broken preview for SVG files missing XML namespace #55

Open sovietspaceship2 opened 5 years ago

sovietspaceship2 commented 5 years ago

Previewing some svg file results in this:

Screen Shot 2019-04-09 at 12 36 16

Screen Shot 2019-04-09 at 12 38 57

which points to /media/preview.js:16

Code version: 1.32.3, clean install, on macOS Extension version: 2.0.0 from marketplace

sovietspaceship2 commented 5 years ago

Seems to only happen with svg files missing xmlns="http://www.w3.org/2000/svg", which is not required when svg is parsed as html (https://www.w3.org/TR/SVG2/struct.html#Namespace).

(My usecase is svg files meant to be used as html template fragments, which may be outside of the scope of this extension, workaround is just adding the required attribute to all svg files)