Repository navigation
Comparing changes
Open a pull request
base repository: svg/svgo
base: v4.0.1
head repository: svg/svgo
compare: v4.0.2
- 10 commits
- 27 files changed
- 7 contributors
Commits on Mar 8, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 38625dd - Browse repository at this point
Copy the full SHA 38625ddView commit details -
fix(convertPathData): introducing isSafeToRemove (#2164)
Removing useless commands: a tricky and inconsistent business. SVGO currently uses two approaches: - **!maybeHasStrokeAndLinecap** for the purpose of removing useless line commands This works decently. It allows for removing useless lines, while not removing dots. Flaw: Even in a path with linecaps, if there are "dot" commands after the first move, they wouldn't render at all and should be removed. They currently aren't. - **isSafeToUseZ** for the purpose of removing useless `z` commands isSafeToUseZ is defined as either having no stroke or having a all-round stroke. When that's true, a line home and a z command render the same way, and can be exchanged or removed. Flaw: This works great when removing a redundant `z` that comes right after another command, but what if the `z` is the first move (for the purpose of creating a dot)? Then it's incorrectly removed. This is shown in #2158 and #2163. This PR introduces isSafeToRemove to help. It's worth reading through the code, but the TLDR is that it uses a more sane method, categorizing the path into non-stroked, stroked + first draw command, and stroked but non-first command, and using fitting behavior in each case. Fixes #2158 and fixes #2163.
Configuration menu - View commit details
-
Copy full SHA for a41a7c1 - Browse repository at this point
Copy the full SHA a41a7c1View commit details
Commits on Mar 13, 2026
-
fix(convertPathData): properly handle consecutive t commands (#2156)
consecutive t commands have been mishandled for years (even with 40b57f3, i believe the second `t` doesn't get converted to a `q`). that changes now. this would allow the folks over at remarkablemark/texsvg#762 to use convertPathData again. --------- Co-authored-by: Claude <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 65548f4 - Browse repository at this point
Copy the full SHA 65548f4View commit details
Commits on Mar 14, 2026
-
fix: only call encodeSVGDatauri once and add test case (#2053)
encodeSVGDatauri() is called within the optimize() function, but was being called a second time in coa.js when SVGO was run from the command line, giving a doubly-encoded, incorrect result. This PR removes the call from coa.js and adds a test case. Resolves #2048 resolves #997. Co-authored-by: KTibow <KTibow@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for a8c19aa - Browse repository at this point
Copy the full SHA a8c19aaView commit details
Commits on Mar 20, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 7414f73 - Browse repository at this point
Copy the full SHA 7414f73View commit details
Commits on Mar 25, 2026
-
fix(convertColors): skip convertCase on css custom properties (#2213)
When this was originally implemented, we correctly handled some things like ignoring URL references, but forgot to ignore CSS custom property references. I've added a new helper in lib/svgo/tools.js which we can reuse to check for and ignore this case. The check actually only looks for `var(--`, I think that's enough, and avoids having to handle the specific syntax rules or the optional second argument of `var` like a fallback (which itself can be a `var`).
Configuration menu - View commit details
-
Copy full SHA for 6fd5872 - Browse repository at this point
Copy the full SHA 6fd5872View commit details
Commits on Apr 9, 2026
-
docs(removeAttributesBySelector): properly document and check types (#…
…2215) I'm uncertain if the switch to `matches` in #1978 is a good idea perfwise. But it has a subset which are clearly good ideas, so this PR is just those. - better documentation - better types - warning on incorrect configuration - more tests --------- Co-authored-by: soren121 <soren121@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for eb4c8b6 - Browse repository at this point
Copy the full SHA eb4c8b6View commit details
Commits on Apr 17, 2026
-
performance: speed up mergePath child node removal (#2216)
Improved performance on mergePaths plugin. Changed the to-be-deleted node from a list to Set. I ran into performance issues with large files, and some of them were significantly improved by changing the data structure. Does not change any behavior: the list was previously used just for .includes, which is an O(n) call. The .has in set is O(1). Co-authored-by: Jussi Timonen <jussi.timonen.ext@konecranes.com>
Configuration menu - View commit details
-
Copy full SHA for 581fe68 - Browse repository at this point
Copy the full SHA 581fe68View commit details
Commits on Jul 11, 2026
-
Match JavaScript URIs case insensitively, such as JAVASCRIPT or JavaScript. Match <*:script> elements that are explicitly namespaced/prefixed with the SVG namespace or XHTML namespace. We leave intact any other namespace like a custom <filmmaker:script> script which isn't executable.
Configuration menu - View commit details
-
Copy full SHA for f529cfc - Browse repository at this point
Copy the full SHA f529cfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for b2309cf - Browse repository at this point
Copy the full SHA b2309cfView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v4.0.1...v4.0.2