From: Matt S Trout Date: Sun, 23 Oct 2011 03:41:41 +0000 (+0000) Subject: make FeedGenerator pretty-print the XML X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8509b33bc2ef5867837335b373dc390c33a643e6;p=scpubgit%2FSCS.git make FeedGenerator pretty-print the XML --- diff --git a/lib/SCSite/FeedGenerator.pm b/lib/SCSite/FeedGenerator.pm index 463ce56..981865c 100644 --- a/lib/SCSite/FeedGenerator.pm +++ b/lib/SCSite/FeedGenerator.pm @@ -62,15 +62,15 @@ sub _feed_data_to_tags { feed title subtitle link id ); my ($web_url, $feed_url) = @{$data}{qw(web_url feed_url)}; - (\'', - , - , $data->{title}, , + (\'', "\n", + , "\n", + ' ', , $data->{title}, , "\n", ($data->{subtitle} - ? (, $data->{subtitle}, ) + ? (' ', , $data->{subtitle}, , "\n",) : ()), - , - , - , $data->{id}, , + ' ', , "\n", + ' ', , "\n", + ' ', , $data->{id}, , "\n", (map $self->_entry_data_to_tags($_), @{$data->{entries}}), ); } @@ -79,18 +79,18 @@ sub _entry_data_to_tags { my ($self, $data) = @_; use XML::Tags qw(entry title link id published updated summary content); my $web_url = $data->{web_url}; - , - , $data->{title}, , - , - , $self->_id_for($data->{web_url}), , - , $data->{created}, , - , ($data->{created}||$data->{updated}), , + ' ', , "\n", + ' ', , $data->{title}, , "\n", + ' ', , "\n", + ' ', , $self->_id_for($data->{web_url}), , "\n", + ' ', , $data->{created}, , "\n", + ' ', , ($data->{created}||$data->{updated}), , "\n", ($data->{summary_html} - ? (, \($data->{summary_html}), ) + ? (' ', , \($data->{summary_html}), , "\n") : () ), - , \($data->{body_html}), , - ; + ' ', , \($data->{body_html}), , "\n", + ' ', , "\n"; } 1;