diff options
-rw-r--r-- | lib/PublicInbox/RepobrowseGitAtom.pm | 3 | ||||
-rw-r--r-- | t/repobrowse_git_atom.t | 2 |
2 files changed, 5 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); } } diff --git a/t/repobrowse_git_atom.t b/t/repobrowse_git_atom.t index 4f0078eb..1f8e95e3 100644 --- a/t/repobrowse_git_atom.t +++ b/t/repobrowse_git_atom.t @@ -20,6 +20,8 @@ test_psgi($test->{app}, sub { is($p->format, "Atom", "parsed atom feed"); is(scalar $p->entries, 6, "parsed six entries"); } + like($body, qr!<pre\s*[^>]+>\* header:\n add header</pre>!, + 'body wrapped in <pre>'); $res = $cb->(GET($req . '/')); my $sl = dechunk($res); |