Skip to content

Commit 5d9c64b

Browse files
Fix line spacing for plaintext previews (#22699)
Adding `<br>` between each line is not necessary since the entire file is rendered inside a `<pre>` fixes https://codeberg.org/Codeberg/Community/issues/915
1 parent 4e946e5 commit 5d9c64b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

modules/charset/escape.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func EscapeControlReader(reader io.Reader, writer io.Writer, locale translation.
4444
return streamer.escaped, err
4545
}
4646

47-
// 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
47+
// 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.
4848
func EscapeControlStringReader(reader io.Reader, writer io.Writer, locale translation.Locale, allowed ...rune) (escaped *EscapeStatus, err error) {
4949
bufRd := bufio.NewReader(reader)
5050
outputStream := &HTMLStreamerWriter{Writer: writer}
@@ -65,10 +65,6 @@ func EscapeControlStringReader(reader io.Reader, writer io.Writer, locale transl
6565
}
6666
break
6767
}
68-
if err := streamer.SelfClosingTag("br"); err != nil {
69-
streamer.escaped.HasError = true
70-
return streamer.escaped, err
71-
}
7268
}
7369
return streamer.escaped, err
7470
}

0 commit comments

Comments
 (0)