small fry
This commit is contained in:
parent
9ad44bdec0
commit
9259079d61
3 changed files with 3 additions and 4 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
#### Improvements 🔧
|
#### Improvements 🔧
|
||||||
|
|
||||||
- Local images can now be included, e.g. `icon: ./my_img.png`.
|
- Local images can now be included, e.g. `icon: ./my_img.png`.
|
||||||
[#146](https://github.com/terrastruct/d2/issues/146)
|
[#146](https://github.com/terrastruct/d2/issues/146)
|
||||||
|
|
||||||
#### Bugfixes 🔴
|
#### Bugfixes 🔴
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ func inline(ms *xmain.State, in []byte, isRemote bool) ([]byte, error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if resp.err != nil {
|
if resp.err != nil {
|
||||||
ms.Log.Error.Printf("image failed to fetch: %s", resp.err.Error())
|
ms.Log.Error.Printf("image failed to fetch: %v", resp.err)
|
||||||
} else {
|
} else {
|
||||||
svg = strings.Replace(svg, resp.srctxt, fmt.Sprintf(`<image href="%s"`, resp.data), 1)
|
svg = strings.Replace(svg, resp.srctxt, fmt.Sprintf(`<image href="%s"`, resp.data), 1)
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,6 @@ var transport = http.DefaultTransport
|
||||||
func fetch(ctx context.Context, srctxt, href string, respChan chan resp) {
|
func fetch(ctx context.Context, srctxt, href string, respChan chan resp) {
|
||||||
req, err := http.NewRequestWithContext(ctx, "GET", href, nil)
|
req, err := http.NewRequestWithContext(ctx, "GET", href, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
||||||
respChan <- resp{err: err}
|
respChan <- resp{err: err}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ width="328" height="587" viewBox="-100 -131 328 587"><style type="text/css">
|
||||||
case pngURL:
|
case pngURL:
|
||||||
body = string(testPNGFile)
|
body = string(testPNGFile)
|
||||||
default:
|
default:
|
||||||
t.Fatal(req.URL.String())
|
t.Fatal(req.URL)
|
||||||
}
|
}
|
||||||
return &http.Response{
|
return &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue