orrg

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/orrg.git
Log | Files | Refs | README | LICENSE

commit 01d0eb250880b32d366fbfa861c1e452094f6a0a
parent 33875dd1e6936d33e97dfaca4c2f82c92558034a
Author: René Wagner <rwagner@rw-net.de>
Date:   Fri, 27 Nov 2020 20:17:49 +0100

improve formatting in some cases

Diffstat:
Morrg.pl | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/orrg.pl b/orrg.pl @@ -74,20 +74,22 @@ sub create_response my $hs = HTML::Strip->new(emit_spaces => 0, auto_reset => 1); foreach my $it ($feed->get_item()) { - push @body, '### '. $it->title; + push @body, $it->description ne '' ? '### '. $it->title : $it->title; if ($it->pubDate ne '') { my $dt = DateTime::Format::ISO8601->parse_datetime($it->pubDate); push @body, 'published '. strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($dt->epoch)); } - push @body, ''; if ($it->description ne '') { + push @body, ''; my $desc = $it->description; + chomp $desc; $desc =~ s/\<li\>/* /ig; + $desc =~ s/\<br \/\>/\r\n/ig; push @body, $hs->parse($desc); } $it->link eq '' or push @body, ('=> '.$it->link.' open entry in browser', ''); } - + return @body; }