diff --git a/lib/imgbundler/imgbundler.go b/lib/imgbundler/imgbundler.go index 0cc88fc2b..5d705d60e 100644 --- a/lib/imgbundler/imgbundler.go +++ b/lib/imgbundler/imgbundler.go @@ -6,6 +6,7 @@ import ( "fmt" "io/ioutil" "net/http" + "net/url" "os" "regexp" "strings" @@ -15,8 +16,7 @@ import ( "oss.terrastruct.com/d2/lib/xmain" ) -var uriImgRe = regexp.MustCompile(``, href) + matches := imageRe.FindAllStringSubmatch(str, -1) + if len(matches) != 1 { + t.Fatalf("uri regex didn't match %s", str) + } + } +} + func TestInlineRemote(t *testing.T) { svgURL := "https://icons.terrastruct.com/essentials/004-picture.svg" pngURL := "https://cdn4.iconfinder.com/data/icons/smart-phones-technologies/512/android-phone.png"