Problem: TODO and DONE are shown a normal text links
Solution: Replace TODO and DONE tags with checkboxes
This commit is contained in:
parent
a8fb7f62ad
commit
d22f3e123a
8
main.go
8
main.go
|
@ -937,8 +937,16 @@ func renderLinks(pageText string, edit bool) string {
|
||||||
s = strings.TrimSuffix(s, "]]")
|
s = strings.TrimSuffix(s, "]]")
|
||||||
s = strings.TrimSpace(s)
|
s = strings.TrimSpace(s)
|
||||||
if tag {
|
if tag {
|
||||||
|
switch s {
|
||||||
|
case "TODO":
|
||||||
|
return fmt.Sprint(`[ ] `)
|
||||||
|
case "DONE":
|
||||||
|
return fmt.Sprint(`[X] `)
|
||||||
|
default:
|
||||||
return fmt.Sprintf(`<a href=%q class="tag">%s</a>`, cleanNameURL(s), s)
|
return fmt.Sprintf(`<a href=%q class="tag">%s</a>`, cleanNameURL(s), s)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editPart := ""
|
editPart := ""
|
||||||
if edit {
|
if edit {
|
||||||
editPart = "edit/"
|
editPart = "edit/"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user