From a817e10a4f94270d064fee0f18328efb910d9c35 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 26 Jan 2019 20:05:56 +0000 Subject: view: swap CRLF for LF in HTML output 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 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 41a45b0b..5aaa72ba 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -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 = []; -- cgit v1.2.3-24-ge0c7