Skip to content

Commit 9cde526

Browse files
Fix line spacing for plaintext previews (#22699) (#22701)
Backport #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 4c20be7 commit 9cde526

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
@@ -45,7 +45,7 @@ func EscapeControlReader(reader io.Reader, writer io.Writer, locale translation.
4545
return streamer.escaped, err
4646
}
4747

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

0 commit comments

Comments
 (0)