This is the issue I am facing:
SVGs have begun to open as regular files, which I do not need, I would like to view them as HTML markup.
I do not know how this has happened. I haven't made any changes to my VS Code, I haven't installed any extensions recently and the day before yesterday this working was fine.
This is the issue I am facing:
SVGs have begun to open as regular files, which I do not need, I would like to view them as HTML markup.
I do not know how this has happened. I haven't made any changes to my VS Code, I haven't installed any extensions recently and the day before yesterday this working was fine.
It's a new feature for last version. I prefer to see the XML markup too.
I found your post looking for how to disable it, but I found the solution in another website.
Go to settings, search for workbench.editorAssociations and add item with key: *.svg and value: default
Screenshot:
VS Code was recently updated to render SVG files as previews by default.
Paste this in your settings.json
to disable the feature:
"workbench.editorAssociations": {
"*.svg": "default"
}
You must be using the Insiders Build as there was a recent commit that enabled previewing svg's just like other "images".
You can do one of two things.
Right-click on the file in the Explorer and choose Open With...
and then select the Text Editor
option and you should get the svg code.
You can set the default to be to open svg files in a text editor instead of an image preview from that same context menu. Choose the Configure default editor for *.svg files
and it will always open in a text editor thereafter.