Skip to content

Commit a398a06

Browse files
Fix PrefixLineBreaks cross-platform bug
1 parent 20438e6 commit a398a06

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/HttpGenerator.Core/StringExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ public static string Prefix(this string str, string prefix)
5656

5757
public static string? PrefixLineBreaks(this string value, string prefix = "###") =>
5858
value
59-
?.Replace(
60-
Environment.OSVersion.Platform == PlatformID.MacOSX ||
61-
Environment.OSVersion.Platform == PlatformID.Unix
62-
? "\r\n" // Environment.NewLine value for non-Unix platforms
63-
: "\n", // Environment.NewLine value for Unix platforms
64-
$"{Environment.NewLine}{prefix} ");
59+
?.Replace("\r\n", "\n")
60+
.Replace("\n", $"{Environment.NewLine}{prefix} ");
6561
}

0 commit comments

Comments
 (0)