]> Sergey Matveev's repositories - public-inbox.git/commitdiff
hval: fixup bad line endings in HTML output
authorEric Wong <e@80x24.org>
Mon, 15 Sep 2014 20:47:02 +0000 (20:47 +0000)
committerEric Wong <e@80x24.org>
Mon, 15 Sep 2014 20:47:02 +0000 (20:47 +0000)
We should do this in filter, too, but sometimes we
prefer to avoid filtering the message at all.

lib/PublicInbox/Hval.pm

index 9be163aa70c13b39eb19c326458886ef1a9f75c8..68f895460821569e9ba67a01902af6248e9692c5 100644 (file)
@@ -55,6 +55,7 @@ my %xhtml_map = (
 
 sub ascii_html {
        my ($s) = @_;
+       $s =~ s/\r\n/\n/sg; # fixup bad line endings
        $s =~ s/([<>&'"])/$xhtml_map{$1}/ge;
        $enc_ascii->encode($s, Encode::HTMLCREF);
 }