From 3f4d5e2522612f8ccdd1e700e8ff644e1d613aa1 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 10 Dec 2017 13:53:20 +1300 Subject: [PATCH] preserve consecutive whitespaces in chat messages --- ArchiveState.go | 10 +++++----- static/style.css | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ArchiveState.go b/ArchiveState.go index 22af35a..c050af8 100644 --- a/ArchiveState.go +++ b/ArchiveState.go @@ -95,7 +95,7 @@ func (this *ArchiveState) renderView(w http.ResponseWriter) { output := "" for i := startLine; i < endLine; i += 1 { - output += html.EscapeString(lines[i]) + "
\n" + output += html.EscapeString(lines[i]) + "\n" } this.renderTemplate(w, []byte(output)) @@ -327,15 +327,15 @@ func (this *ArchiveState) renderTemplateHead(w http.ResponseWriter) { -
- `)) +
`, + )) // Header ends } func (this *ArchiveState) renderTemplateFoot(w http.ResponseWriter) { - w.Write([]byte(` -
+ w.Write([]byte(`
+ diff --git a/static/style.css b/static/style.css index c72e234..645f68b 100644 --- a/static/style.css +++ b/static/style.css @@ -61,6 +61,7 @@ select { #chatarea { word-break:break-word; + white-space: pre; } .timestamp {