From 422582afb41cfbc71b6c796613662d7821910920 Mon Sep 17 00:00:00 2001 From: crystal <71373843+CrystalCommunication@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:23:15 -0700 Subject: [PATCH 1/2] don't add
after every newline for plaintext files --- modules/charset/escape.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/charset/escape.go b/modules/charset/escape.go index e6009989371d7..dc7f8db957c24 100644 --- a/modules/charset/escape.go +++ b/modules/charset/escape.go @@ -66,10 +66,6 @@ func EscapeControlStringReader(reader io.Reader, writer io.Writer, locale transl } break } - if err := streamer.SelfClosingTag("br"); err != nil { - streamer.escaped.HasError = true - return streamer.escaped, err - } } return streamer.escaped, err } From ef186293786e481b929a29d85633290527e1889f Mon Sep 17 00:00:00 2001 From: crystal <71373843+CrystalCommunication@users.noreply.github.com> Date: Wed, 1 Feb 2023 13:23:13 -0700 Subject: [PATCH 2/2] add a notice to the function comment --- modules/charset/escape.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/charset/escape.go b/modules/charset/escape.go index dc7f8db957c24..df10c8fbd0a29 100644 --- a/modules/charset/escape.go +++ b/modules/charset/escape.go @@ -45,7 +45,7 @@ func EscapeControlReader(reader io.Reader, writer io.Writer, locale translation. return streamer.escaped, err } -// EscapeControlStringReader escapes the unicode control sequences in a provided reader of string content and writer in a locale and returns the findings as an EscapeStatus and the escaped []byte +// EscapeControlStringReader escapes the unicode control sequences in a provided reader of string content and writer in a locale and returns the findings as an EscapeStatus and the escaped []byte. HTML line breaks are not inserted after every newline by this method. func EscapeControlStringReader(reader io.Reader, writer io.Writer, locale translation.Locale, allowed ...rune) (escaped *EscapeStatus, err error) { bufRd := bufio.NewReader(reader) outputStream := &HTMLStreamerWriter{Writer: writer}