Browse Source

refactor: use empty caption from function call

decentral1se 3 years ago
parent
commit
bdadec0bbe
No known key found for this signature in database GPG Key ID: 3789458B3D0C410
  1. 8
      distribusi.go

8
distribusi.go

@ -558,17 +558,11 @@ func getHref(c *cli.Context, fpath string, mtype string) (bool, string, error) {
href = fmt.Sprintf("<pre>%s</pre>", trimFinalNewline(fcontents))
}
} else if ftype == "image" {
var caption string
exifCaption, err := getCaption(c, fpath)
caption, err := getCaption(c, fpath)
if err != nil {
return unknown, href, nil
}
if exifCaption != "" {
caption = exifCaption
}
if stype == "gif" {
href = fmt.Sprintf("<figure><a href=\"%s\"><img class='%s' loading='lazy' src=\"%s\" /></a><figcaption>%s</figcaption></figure>", fname, stype, fname, caption)
} else {

Loading…
Cancel
Save