refactor: define tags on separate line for readability

This commit is contained in:
decentral1se 2022-02-05 15:50:54 +01:00
parent fba7d4cacf
commit cd6fb4b88a
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 10 additions and 5 deletions

View File

@ -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)
}
}