vscode-svgviewer icon indicating copy to clipboard operation
vscode-svgviewer copied to clipboard

Broken preview for SVG files missing XML namespace

Open sovietspaceship2 opened this issue 5 years ago • 1 comments

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 avatar Apr 09 '19 11:04 sovietspaceship2

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)

sovietspaceship2 avatar Apr 09 '19 11:04 sovietspaceship2