more updates

This commit is contained in:
2025-05-24 11:45:48 +02:00
parent f486598b8c
commit 97297be163
11 changed files with 242 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import (
"crypto/md5"
"encoding/base64"
"encoding/hex"
"fmt"
"strings"
"sync"
"time"
@@ -11,8 +12,17 @@ import (
// NewDiagram returns a new diagram.
func NewDiagram(description []byte, imgType string) *Diagram {
// Debug: Log what we received
fmt.Printf("DEBUG: Received %d bytes\n", len(description))
fmt.Printf("DEBUG: Raw bytes: %q\n", string(description))
fmt.Printf("DEBUG: Contains newlines: %t\n", strings.Contains(string(description), "\n"))
trimmed := strings.TrimSpace(string(description))
fmt.Printf("DEBUG: After TrimSpace: %q\n", trimmed)
fmt.Printf("DEBUG: Still contains newlines: %t\n", strings.Contains(trimmed, "\n"))
return &Diagram{
description: []byte(strings.TrimSpace(string(description))),
description: []byte(trimmed),
lastTouched: time.Now(),
mu: &sync.RWMutex{},
imgType: imgType,