From b5053e0efa641ecf56550d7e7d4dd19f1f939550 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 6 May 2025 22:36:12 +0530 Subject: Replacing \n with
in dump --- cmd/dump.go | 2 ++ cmd/root.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/dump.go b/cmd/dump.go index 281b7d6..a0deba7 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -21,6 +21,7 @@ import ( "fmt" "log" "bytes" + "strings" "text/template" "vidhukant.com/guestbook/db" @@ -58,6 +59,7 @@ var dumpCmd = &cobra.Command{ if err := rows.Scan(&entry.Name, &entry.Website, &entry.Message); err != nil { log.Fatal(err) } + entry.Message = strings.Replace(entry.Message, "\n", "
", -1) entries = append(entries, entry) } if rows.Err() != nil { diff --git a/cmd/root.go b/cmd/root.go index 2d1e63d..18a1520 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,7 +27,7 @@ import ( var rootCmd = &cobra.Command{ Use: "guestbook", - Version: "v1.0.0", + Version: "v1.2.0", Short: "Standalone guestbook server for static websites", Long: "Standalone guestbook server for static websites", } -- cgit v1.2.3