Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: svg/svgo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.1
Choose a base ref
...
head repository: svg/svgo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.2
Choose a head ref
  • 10 commits
  • 27 files changed
  • 7 contributors

Commits on Mar 8, 2026

  1. Configuration menu
    Copy the full SHA
    38625dd View commit details
    Browse the repository at this point in the history
  2. 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.
    KTibow authored Mar 8, 2026
    Configuration menu
    Copy the full SHA
    a41a7c1 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2026

  1. 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>
    KTibow and claude authored Mar 13, 2026
    Configuration menu
    Copy the full SHA
    65548f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2026

  1. 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>
    johnkenny54 and KTibow authored Mar 14, 2026
    Configuration menu
    Copy the full SHA
    a8c19aa View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2026

  1. Configuration menu
    Copy the full SHA
    7414f73 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2026

  1. 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`).
    SethFalco authored Mar 25, 2026
    Configuration menu
    Copy the full SHA
    6fd5872 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2026

  1. 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>
    KTibow and soren121 authored Apr 9, 2026
    Configuration menu
    Copy the full SHA
    eb4c8b6 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2026

  1. 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>
    mozzie and jussiKC authored Apr 17, 2026
    Configuration menu
    Copy the full SHA
    581fe68 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2026

  1. Merge commit from fork

    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.
    SethFalco authored Jul 11, 2026
    Configuration menu
    Copy the full SHA
    f529cfc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b2309cf View commit details
    Browse the repository at this point in the history
Loading