]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: swap CRLF for LF in HTML output
authorEric Wong <e@80x24.org>
Sat, 26 Jan 2019 20:05:56 +0000 (20:05 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Jan 2019 23:05:46 +0000 (23:05 +0000)
It makes no difference to browsers aside from saving a few
bytes; and this means we won't have to worry about extra
'%0D' showing up in links to solver.

lib/PublicInbox/View.pm

index 41a45b0b6682a158a37c6323e492543a3d173793..5aaa72ba1fd9be0c8f8b5b69329fc34757732aa4 100644 (file)
@@ -557,6 +557,10 @@ sub add_text_body {
 
        return attach_link($upfx, $ct, $p, $fn) unless defined $s;
 
+       # makes no difference to browsers, and don't screw up filename
+       # link generation in diffs with the extra '%0D'
+       $s =~ s/\r\n/\n/sg;
+
        my ($diff, $spfx);
        if ($s =~ /^(?:diff|---|\+{3}) /ms) {
                $diff = [];