Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

SVG preview doesn't work #25

Open
yantakus opened this issue Jan 17, 2017 · 12 comments
Open

SVG preview doesn't work #25

yantakus opened this issue Jan 17, 2017 · 12 comments

Comments

@yantakus
Copy link

When I press Alt+S O or choose SVG Viewer: View SVG from the command palette nothing happens.

The filetype is XML. Extension version: 1.3.0. VS Code version: 1.8.1.

@cssho
Copy link
Owner

cssho commented Feb 2, 2017

@yantakus

nothing happens.

Have you not received an error message ? (developper tool or vscode standard message)
Don't open a preview window?

@curioussavage
Copy link

Mine also doesn't work no errors when I use the command. I did see an error later saying no svg inactive workspace. Super delayed.

@abudaan
Copy link

abudaan commented Apr 14, 2017

On Ubuntu I get the message: "Active editor doesn't show a SVG document - no properties to preview."
I am testing with an SVG file that I found in this repository:

<?xml version="1.0"?>
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
 <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
 <g>
  <title>Layer 1</title>
  <circle stroke="#333333" fill-opacity="0" id="svg_4" r="48.000004" cy="59.500001" cx="105" stroke-width="20" fill="#000000"/>
  <rect cy="60" transform="rotate(45 37.99999999999999,125.5) " id="svg_7" height="85" width="20" y="83" x="28" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="10" fill="#333333" stroke-opacity="0" stroke="#000000"/>
  <path stroke="#000000" stroke-opacity="0" id="svg_2" d="m124.592659,149.699597c7.254473,0 14.508951,0 21.763424,0c0,5.010636 0,10.021277 0,15.031913c-7.254473,0 -14.508951,0 -21.763424,0c0,-5.010636 0,-10.021277 0,-15.031913zm-31.436068,0c8.060478,0 16.121112,0 24.181595,0c0,5.010636 0,10.021277 0,15.031913c-8.060478,0 -16.121112,0 -24.181595,0c0,-5.010636 0,-10.021277 0,-15.031913zm-29.017903,0c8.060478,0 16.121106,0 24.181584,0c0,5.010636 0,10.021277 0,15.031913c-8.060478,0 -16.121112,0 -24.181584,0c0,-5.010636 0,-10.021277 0,-15.031913zm-29.017903,0c8.060478,0 16.121106,0 24.181589,0c0,5.010636 0,10.021277 0,15.031913c-8.060483,0 -16.121106,0 -24.181589,0c0,-5.010636 0,-10.021277 0,-15.031913zm89.471874,30.998507c7.657545,-0.339387 15.314956,0.239793 22.972507,-0.099594c0.491331,-5.289003 0.263753,-10.578018 0.755084,-15.867022c7.166219,0 15.051349,0 22.217417,0c0,-5.010636 0,-10.02128 0,-15.031913c-7.254473,0 -14.508951,0 -21.763424,0c0,-5.567385 0,-11.134756 0,-16.702127c-8.060478,0 -16.121106,0 -24.181584,0c0,-5.010636 0,-10.021277 0,-15.031913c8.060478,0 16.121106,0 24.181584,0c0,5.010636 0,10.021277 0,15.031913c7.166074,0 15.051203,-0.248272 22.217417,-0.248272c0.491331,5.288989 0.263758,10.826287 0.755095,16.11529c7.65754,0.339376 15.422955,-0.028791 23.080511,0.310584c0,4.949635 -0.108009,10.606794 -0.108009,15.556437c-8.060478,0 -16.121106,0 -24.181584,0c0,5.567382 0,11.134745 0,16.702127c-7.254473,0 -14.508951,0 -21.763424,0c0,5.010636 0,10.021277 0,15.031913c-8.060478,0 -16.121106,0 -24.181584,0c0,-4.949635 0,-10.817796 0,-15.767435l-0.000005,0.000011z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="15" fill="#333333"/>
 </g>
</svg>

@cssho
Copy link
Owner

cssho commented Apr 22, 2017

@abudaan The condition in which the message is displayed is when languageId is not xml or the end of the file does not end with "</ svg>".
Has that file been saved already?

@abudaan
Copy link

abudaan commented May 1, 2017

Thanks for your reply; meanwhile I did a clean install of Xubuntu 17.04, vscode and your plugin and it works like a charm now! I guess my old installation was corrupted.

@deevincentday
Copy link

deevincentday commented May 15, 2018

Does not work for me either. there is no option in the context menu the keyboard method does not work and when I use the command line to open the preview the image I see is not my SVG but something resembling a miniature postage stamp. There are no error messages at all.

@AlexanderLieret
Copy link

Did not work for me either. But it does work after installing XML Tools.

@ZuBB
Copy link

ZuBB commented Mar 29, 2019

Did not work for me either. But it does work after installing XML Tools.

just my 5c: this hint did not help me 😞

@dkniffin
Copy link

dkniffin commented Jul 5, 2019

For me the trick was to not split my opening SVG tag's attributes onto multiple lines

@spacepluk
Copy link

For me the trick was to not split my opening SVG tag's attributes onto multiple lines

This worked for me, thanks!

@Eitz
Copy link

Eitz commented Sep 3, 2019

For me the trick was to not split my opening SVG tag's attributes onto multiple lines

Same thing here. There's probably a bad parser being used by this extension.

@gilles6
Copy link

gilles6 commented Oct 16, 2019

I also got the message:

Active editor doesn't show a SVG document - no properties to preview.

I fixed it by installing the XML Tools extension and then apply Format Document from View>Command Palette....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests