chore: fmt

This commit is contained in:
pat-s 2025-03-28 09:59:25 +01:00
parent 1eb8d5727d
commit 2c4b3e68a8
No known key found for this signature in database
GPG key ID: 3C6318841EF78925

View file

@ -50,17 +50,17 @@ func Normalize(data []byte, size any) []byte {
normalized = normalizeVars.reAttrClassPrefix.ReplaceAll(normalized, []byte(` class="`))
normalized = bytes.TrimSpace(normalized)
sizeStr := ""
switch v := size.(type) {
case string:
sizeStr = v
case int:
sizeStr = fmt.Sprintf("%dpx", v)
default:
sizeStr = "16px"
}
sizeStr := ""
switch v := size.(type) {
case string:
sizeStr = v
case int:
sizeStr = fmt.Sprintf("%dpx", v)
default:
sizeStr = "16px"
}
normalized = fmt.Appendf(normalized, ` width="%s" height="%s"`, sizeStr, sizeStr)
normalized = fmt.Appendf(normalized, ` width="%s" height="%s"`, sizeStr, sizeStr)
if !bytes.Contains(normalized, []byte(` class="`)) {
normalized = append(normalized, ` class="svg"`...)
}