Browse Source

refactor: define tags on separate line for readability

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

15
distribusi.go

@ -638,16 +638,21 @@ func mkDiv(c *cli.Context, mtype string, href, fname string, unknown bool) (stri
ftype, _ := parseMtype(mtype)
if ftype == "text" {
div = fmt.Sprintf("<div id=\"%s\" class='%s'>%s%s</div>", fname, ftype, href, filename)
divTag := "<div id=\"%s\" class='%s'>%s%s</div>"
div = fmt.Sprintf(divTag, fname, ftype, href, filename)
} else if ftype == "os" {
div = fmt.Sprintf("<div id=\"%s\" class='%s'>%s</div>", fname, ftype, href)
divTag := "<div id=\"%s\" class='%s'>%s</div>"
div = fmt.Sprintf(divTag, fname, ftype, href)
} else {
if unknown {
// we really don't know what this is, so the filename is the href and we avoid adding it again
div = fmt.Sprintf("<div id=\"%s\" class='%s'>%s</div>", fname, ftype, href)
// we really don't know what this is, so the filename is the href and we
// avoid adding it again
divTag := "<div id=\"%s\" class='%s'>%s</div>"
div = fmt.Sprintf(divTag, fname, ftype, href)
} else {
// images, videos, etc. still get a filename
div = fmt.Sprintf("<div id=\"%s\" class='%s'>%s%s</div>", fname, ftype, href, filename)
divTag := "<div id=\"%s\" class='%s'>%s%s</div>"
div = fmt.Sprintf(divTag, fname, ftype, href, filename)
}
}

Loading…
Cancel
Save