Git Product home page Git Product logo

vscode-svg's People

Contributors

ameliabr avatar ansimorph avatar evandemaris avatar laurenttreguier avatar lishu avatar pkief avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-svg's Issues

Pretty SVG strips out ID tags

In the first place thank you very much for this VSCode extension. It really is very useful. I have run into one issue which I find rather bothersome. When you run raw SVG markup through Pretty SVG the process strips out the ID tag. I use my SVGs inline in HTML documents and need to manipulate the image elements by accessing them via the ID tag. I imagine I will not be the only one doing this. Could you either stop this from happening or else provide flags to control just what gets removed when Pretty SVG is run?

Pretty command

Like the minify command but send --pretty to SVGO instead of minifying plugins.

No option to turn off SVG formatting entirely

Frankly, I don't like any of the formatting options this extension provides; it completely mangles my files into something much less readable. Unfortunately, I can't just turn it off. There's a setting for switching off the plugins, but some formatting still appears to happen when I save (with format-on-save turned on).

svg File content disappears on formatting

I love coding svg directly with vscode. I like the code formatting abilities 'on save'.

Unfortunaltely I found that on some circumstances the file content disappears on format/save. Editor and File are empty. This can be reverted [ctrl] [z] but it is annoying.

Some reasons for disappearing:

  • The content is erroneous, e.g. missing close tag,
  • Some xmlns declarations are missing
  • A bitmap image inside.

For now I turned of 'format on save' but I suggest the behavoiur of other formatters:

  • keep the editor text if something on formatting goes wrong, just display a little notice even if the reason is not available.

Thanks in advance.

ervin

P.S. This might also be related to some other svg plugins, therefore I mention them:

  • svgo
  • svg Editor

Change Tab Size pf `Pretty SVG`

Hello,

Is it possible to change the tab size? The default one that Pretty SVG formats the file with is of size 4. I want to change it to 2.

How can I change that?

Destructive Format Document (SVGO)

Integration of SVGO features is really great idea, but binding it as default format provider [1] for SVG syntax seems quite unfortunate to me and might be even dangerous: for example it removes (locally) unused symbols, removes comments and generally alters source far more than plain "Format Document" should. For example document

<svg 
	xmlns="http://www.w3.org/2000/svg" 
	xmlns:xlink="http://www.w3.org/1999/xlink">
	<defs>
		<symbol id="a" viewBox="0 0 32 32">
			<circle r="10"/>
		</symbol>
	</defs>
	<!--
		<use xlink:href="#a"/>
	-->
</svg>

after formatting with the default confing becomes:

<svg xmlns="http://www.w3.org/2000/svg">
<!--<use xlink:href="#a"/>-->
</svg>

what does not seem right. (To get "proper" outcome now one must switch syntax to XML, then invoke "Format document" and switch back.)

I think that only alterations expected from the "Format document" command are indents and line breaks. Not optimizations.

From a quick glance at .svgo.yml [2] it seems that there should be disabled far more plugins in [1] to get simple white-space-wise formatted output. (Perhaps.)

So I'd suggest exporting current formatting / optimizing functionality to a new command and simplify the one used for (expected) simple white space format.

[1] https://github.com/lishu/vscode-svg/blob/master/src/features/svgFormattingProvider.ts
[2] https://github.com/svg/svgo/blob/master/.svgo.yml

Couldn't find message for key configuration.pretty.plugins

When I start my VS Code then I see the following warnings:

[~\.vscode\extensions\jock.svg-0.1.5]: Couldn't find message for key configuration.pretty.plugins.description.

[~\.vscode\extensions\jock.svg-0.1.5]: Couldn't find message for key configuration.pretty.plugins.title.

The description is missing in the nls json and you can see that it's missing in the configuration:

missing description

Auto-completion in html files

Does this work with HTML files, if not that would be a great feature, I rarely work directly with SVG, but I modify SVG inline in HTML files every day.

Add zoom support to the preview

It would be great to be able to zoom in on the preview image. It would also be great if there was an option to auto-zoom when previewing small images.

[Idea] Path directives highlight

It would be neat to have path/glyph d attribute value highlighted so that commands, coordinates, lengths, angles and flags would be more apparent.

Mock (pardon colours):
image

I assume it should be possible; the only danger I see are omittable consecutive commands.

mock.html.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.