Split main

This commit is contained in:
Ettore Di Giacinto
2024-04-11 00:20:49 +02:00
parent f85962769a
commit cb35f871db
4 changed files with 242 additions and 217 deletions

View File

@@ -1,6 +1,9 @@
package main
import "fmt"
import (
"fmt"
"strings"
)
// TODO: switch to https://github.com/chasefleming/elem-go
@@ -19,3 +22,9 @@ func disabledElement(id string, disabled bool) string {
return `<script> document.getElementById('` + id + `').disabled = false;</script>`
}
func htmlIfy(s string) string {
s = strings.TrimSpace(s)
s = strings.ReplaceAll(s, "\n", "<br>")
return s
}