From 4989a9590607d7d1076fce0be220474fcee606bb Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 May 2024 13:20:06 -0600 Subject: [PATCH] do not run imgbundler unnecessarily --- lib/imgbundler/imgbundler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/imgbundler/imgbundler.go b/lib/imgbundler/imgbundler.go index 908b93b57..46352de3f 100644 --- a/lib/imgbundler/imgbundler.go +++ b/lib/imgbundler/imgbundler.go @@ -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()