about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-21 11:50:58 +0000
committerEric Wong <e@80x24.org>2017-01-21 11:52:16 +0000
commit5505b483b66dfa43d6e356502fca3eb58638447c (patch)
tree8f43e32c99234ba9417a7e6c4b4398e4aea55213 /lib/PublicInbox
parent5027b5fad0aa4a448e53eeba4027328dd528c918 (diff)
downloadpublic-inbox-5505b483b66dfa43d6e356502fca3eb58638447c.tar.gz
Commit messages are assumed to be displayed in a terminal
with a fixed width font, so we must preserve newlines and
all whitespace as-is so ASCII art may be displayed properly.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/RepobrowseGitAtom.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/RepobrowseGitAtom.pm b/lib/PublicInbox/RepobrowseGitAtom.pm
index c542281c..87fc60a7 100644
--- a/lib/PublicInbox/RepobrowseGitAtom.pm
+++ b/lib/PublicInbox/RepobrowseGitAtom.pm
@@ -81,6 +81,7 @@ sub git_atom_sed ($$) {
                 qq(<link\nrel="alternate"\ntype="text/html"\nhref="$url"\n/>);
         my ($plinks, $id, $ai);
         my $end = '';
+        my $blines;
         sub {
                 my $dst;
                 # $_[0] == scalar buffer, undef means EOF from "git log"
@@ -102,6 +103,7 @@ sub git_atom_sed ($$) {
                                 if (++$state == STATE_BODY) {
                                         flush_hdr(\$dst, $hdr, $url);
                                         $hdr = {};
+                                        $blines = 0;
                                 }
                                 next;
                         }
@@ -109,6 +111,7 @@ sub git_atom_sed ($$) {
                                 $dst .= qq(</pre></div></content></entry>);
                                 $state = 0;
                         } else {
+                                $dst .= "\n" if $blines++;
                                 $dst .= utf8_html($l);
                         }
                 }