Merge pull request #1948 from alixander/no-unnecessary-bundle

do not run imgbundler unnecessarily
This commit is contained in:
Alexander Wang 2024-05-23 13:25:10 -06:00 committed by GitHub
commit 9ad3ab3005
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,10 @@ func bundle(ctx context.Context, l simplelog.Logger, inputPath string, svg []byt
imgs := imageRegex.FindAllSubmatch(svg, -1)
imgs = filterImageElements(imgs, isRemote)
if len(imgs) == 0 {
return svg, nil
}
ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
defer cancel()