Skip to content

Commit 4592aaf

Browse files
committed
clarify newline normalization
1 parent 5bc6d22 commit 4592aaf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

utils/utils.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ func searchBrowserLauncher(goos string) (browser string) {
5656
}
5757

5858
func normalizeNewlines(d []byte) []byte {
59-
// from https://github.com/MichaelMure/go-term-markdown/issues/1#issuecomment-570702862
60-
// replace CR LF \r\n (windows) with LF \n (unix)
61-
d = bytes.Replace(d, []byte{13, 10}, []byte{10}, -1)
62-
// replace CF \r (mac) with LF \n (unix)
63-
d = bytes.Replace(d, []byte{13}, []byte{10}, -1)
59+
d = bytes.Replace(d, []byte("\r\n"), []byte("\n"), -1)
60+
d = bytes.Replace(d, []byte("\r"), []byte("\n"), -1)
6461
return d
6562
}
6663

0 commit comments

Comments
 (0)