more updates
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user