XhmikosR
1310210d4e
Use https when possible and fix an inactive domain ( #1374 )
2021-02-25 13:48:18 +03:00
Bogdan Chadkin
dd37fcfebb
Apply scale to stroke-dasharray and stroke-dashoffset
2021-02-25 13:45:03 +03:00
Bogdan Chadkin
d06747abca
Keep hidden elements if any descendant enables visibility
2021-02-25 00:05:26 +03:00
Bogdan Chadkin
9d67586787
Keep transparent elements inside <clipPath>
2021-02-24 22:58:00 +03:00
Bogdan Chadkin
d14315b68f
Keep empty <mask> which can hide element by id
2021-02-24 21:13:30 +03:00
Bogdan Chadkin
36391564f2
Preserve stroke-width when marker-end is specified
2021-02-24 17:29:29 +03:00
Bogdan Chadkin
091172a392
Fix <tspan> inside of <a>
2021-02-24 14:10:33 +03:00
Bogdan Chadkin
9263d9ab90
Fix svg spec urls in plugins
2021-02-24 11:18:48 +03:00
Bogdan Chadkin
c1d5f0f7a9
Keep empty <g> when filter attributes is specified
2021-02-23 22:36:47 +03:00
Bogdan Chadkin
776ec1e71b
Fix incorrect xml:space default
2021-02-23 18:43:28 +03:00
Max Goodhart
9f084cc086
Preserve whitespace in elements containing text ( #1220 )
2021-02-23 18:25:30 +03:00
Bogdan Chadkin
a1fcd034fe
Disable convertStyleToAttrs plugin by default ( #1365 )
...
Ref https://github.com/svg/svgo/issues/1362 https://github.com/svg/svgo/issues/1360
From the [spec](https://www.w3.org/TR/SVG11/styling.html#UsingPresentationAttributes ):
> Presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.
Though we replace inline styles with attributes without checking if
thare is any `<style>` element. This makes the plugin unsafe and it
should not be enabled by default.
2021-02-23 00:28:09 +03:00
Bogdan Chadkin
9b97e06ef6
Fix empty <svg /> in cleanupIDs plugin
2021-02-21 14:50:55 +03:00
XhmikosR
727646e6a7
convertTransform: remove unused assignment ( #1354 )
2021-02-20 22:31:56 +03:00
Bogdan Chadkin
c1edce4d2d
Fix error message in addAttributesToSVGElement plugin
...
Ref https://github.com/svg/svgo/issues/1352
2021-02-20 19:04:46 +03:00
一丝
8d7cfa02c7
After ‘arcto’ path command(a or A) flags, spaces are no longer removed by default ( #1353 )
...
Co-authored-by: 壹丝 <jie.lijie@alibaba-inc.com >
2021-02-20 18:58:42 +03:00
XhmikosR
6c0f8c5efb
reusePaths: fix redundant variable assignment ( #1349 )
2021-02-20 17:31:34 +03:00
Bogdan Chadkin
d9f68d3be0
[removeElementsByAttr] fix removing elements when class is empty
...
Ref https://github.com/svg/svgo/issues/937
Regexp didn't not cover the case when class list is empty.
2021-02-20 16:54:46 +03:00
Bogdan Chadkin
4490d62ee9
Add mask-type to the list of <mask> attributes
...
Ref https://github.com/svg/svgo/issues/1254
2021-02-20 13:59:21 +03:00
Bogdan Chadkin
7f4e05297a
[convertEllipseToCircle] fix ellipse without radius
...
Ref https://github.com/svg/svgo/issues/1264
2021-02-20 12:50:36 +03:00
Christian Ruigrok
b9880491b5
[reusePaths] fix excessive defs tag ( #1201 )
2021-02-19 23:56:20 +03:00
Bogdan Chadkin
a7cc20bb43
Setup recommended eslint preset ( #1345 )
...
This is usually enough to prevent silly mistakes.
Formatting will be done by prettier after merging pull requests.
2021-02-19 15:26:07 +03:00
XhmikosR
136a52cdb6
convertStyleToAttrs: fix wrong character class ( #1338 )
2021-02-19 02:30:05 +03:00
Sebastian Kreft
c9a3aea858
Path intersection was not checking paths with circles. ( #1229 )
...
As an optimization the path intersection was checking the paths had three or more elements, caliming that otherwise there was nothing to fill. However a semi circle would actually contain 2 points.
Fixes #1048 .
This adds a simplified test case for the 2 offending files reported in the issue.
2021-02-17 23:50:08 +03:00
Bogdan Chadkin
fd5e6406b1
Upgrade css-select
2021-02-16 19:14:20 +03:00
Bogdan Chadkin
d273b26605
Provide es module bundle for browser ( #1326 )
...
The was a lot of requests to provide browser compatible module. In this
diff I added `svgo/dist/svgo.browser.js` bundle and tested it with
playwright.
2021-02-16 19:11:01 +03:00
Bogdan Chadkin
70d1f2b2f8
Upgrade css-tree and csso
2021-02-16 18:14:10 +03:00
Bogdan Chadkin
225bfbb053
Move config processing into optimize
2021-02-15 16:57:01 +03:00
Bogdan Chadkin
2965e8ccdb
Drop plugin by path support and load builtins statically
2021-02-15 12:00:45 +03:00
alexpavlovich
77464801e7
Fix cleanupIDs if defs is last elem of svg
2019-11-09 21:41:17 +03:00
Cyrille David
1152257505
Perform cleanupIDs optimization when style/script tag is empty
...
cleanupIDs plugin is disabled when a script or style tag is present. I
assume that this is because they might contain an id.
If these tags are empty there is no point in not cleaning the id though.
When running svgo with the option `multipass: true`, it allows us to
first run `inlineStyles` plugin to empty the style tag. Then, we can run
`cleanupIDs` plugin.
2019-11-08 22:58:43 +03:00
Sviatoslav Bulbakha
fafcbd7bd0
Fix prefixIds plugin error with animations
...
Fix #848
2019-11-08 18:36:45 +03:00
jlherren
dfe649fa8d
Fix collapsing of repeated commands in convertPathData plugin
...
This fixes #1166
2019-11-05 19:22:43 +03:00
James Thomson
0e6b0ad8e5
Fix 'cleanupIDs' minify bug due to preserved IDs
...
Prevent 'cleanupIDs' plugin from producing a preserved ID, including one
which matches a preserved prefix, when minifying.
Closes #1158
2019-10-29 22:54:36 +03:00
strarsis
71c7fe74b9
Add multipassCount to info object passed to the plugins.
...
Use info object to skip subsequent passes in prefixIds plugin to prevent unintended, multiple prefixing.
2019-10-29 22:50:59 +03:00
GreLI
023013abf9
Use ’force’ option in ‘mergePaths’ only for paths with same attributes
2019-07-14 19:22:59 +03:00
GreLI
e1dd31cf84
Fix 180deg ‘convertTransform’
...
Fix NaN after Math.acos due to error making illegal value out of bounds
Fix #1101
2019-07-14 18:51:50 +03:00
GreLI
8671c4c3df
Fix incorrect prev arc segment angle calculation.
...
Close #1109
2019-07-14 12:07:59 +03:00
strarsis
5ee68c4808
Add options to prefixIds plugin for selectively prefixing IDs and/or classes.
2019-07-13 22:51:06 +03:00
Taylor Hunt
8e45fa2d58
Add ‘ellipseToCircle’ plugin
...
Converts non-eccentric ellipse elements to circle elements.
Adobe Illustrator seems to be fond of using ellipses even if their rx === ry.
2019-07-13 22:31:22 +03:00
Adi Pascu
31e6a8cb65
Make removeDimensions add viewBox if it's missing
2019-07-13 22:27:47 +03:00
Michael Irigoyen
b9905aa5ec
( Fix #800 ) Add option to the mergePaths plugin, forcing all path attributes to be combined ( #1084 )
...
Add option to the mergePaths plugin, forcing all path attributes to be combined
2019-07-13 22:25:21 +03:00
GreLI
9fe7c28a81
Bump dependencies
2019-07-13 22:10:10 +03:00
GreLI
4dfbd76d59
Fix final sorting condition in ‘sortDefsChildren’
2019-07-13 21:43:36 +03:00
GreLI
258fecfa6b
Remove spaces after ‘arcto’ path command flags
2019-07-13 16:18:08 +03:00
GreLI
95f7603983
Fix removeUnusedNS not counting usage in <svg> tag
...
Close #1107
2019-05-19 20:44:36 +03:00
davidleston
c7058eb7ac
Fixes svg/svgo#761 . Sorting defs to improve compression.
2019-05-04 20:23:30 +03:00
GreLI
d23355e91a
removeAttrs: add optional value filter ( #977 )
2019-02-24 22:01:01 +03:00
bbqaaq
5d97108687
update namespace list ( #1064 )
2019-02-24 21:04:24 +03:00
Brad Kotsopoulos
7eeb5d064d
Add config to preserve IDs based on prefix matching ( #1060 )
...
add parameter to preserve IDs based on prefix matching
2019-02-24 21:02:03 +03:00