do not run imgbundler unnecessarily
This commit is contained in:
parent
0a54cb48f1
commit
4989a95906
1 changed files with 4 additions and 0 deletions
|
|
@ -52,6 +52,10 @@ func bundle(ctx context.Context, l simplelog.Logger, inputPath string, svg []byt
|
||||||
imgs := imageRegex.FindAllSubmatch(svg, -1)
|
imgs := imageRegex.FindAllSubmatch(svg, -1)
|
||||||
imgs = filterImageElements(imgs, isRemote)
|
imgs = filterImageElements(imgs, isRemote)
|
||||||
|
|
||||||
|
if len(imgs) == 0 {
|
||||||
|
return svg, nil
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
|
ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue