refactor: define tags on separate line for readability
This commit is contained in:
parent
fba7d4cacf
commit
cd6fb4b88a
|
@ -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…
Reference in New Issue