commit a354cf94d629843e4a3f17fe9d48ad3ea4d89ba4
parent 3a8b1c9b9529a20915c21c16c2004e5dbde83893
Author: René Wagner <rwagner@rw-net.de>
Date: Tue, 15 Dec 2020 19:07:54 +0100
convert <h1/2> in item content to third-level headers
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/orrg.pl b/orrg.pl
@@ -51,7 +51,6 @@ sub create_response
$feed->image eq '' or push @body, '=> '. $feed->image .' feed image';
$feed->link eq '' or push @body, ('=> '.$feed->link.' open website', '');
- push @body, ('## recent feed items', '');
foreach my $it ($feed->get_item()) { push @body, @{item($it)}; }
push @body, ('', '', '=> index.pl [home]');
@@ -70,7 +69,7 @@ sub item
$title =~ s/\s+$//ig;
$link =~ s/^\s+//ig;
$link =~ s/\s+$//ig;
- push @item, ($it->description ne '' || $it->pubDate ne '')? '### '. $title : $title;
+ push @item, ($it->description ne '' || $it->pubDate ne '')? '## '. $title : $title;
if ($it->pubDate ne '') {
my $dt = DateTime::Format::ISO8601->parse_datetime($it->pubDate);
push @item, 'published '. strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($dt->epoch));
@@ -79,6 +78,7 @@ sub item
if ($it->description ne '') {
my $desc = $it->description;
$desc =~ s/\<li\>/* /igm;
+ $desc =~ s/\<h[1-2][^\>]+\>/### /igm;
$desc =~ s/\<br \/\>/\r\n/igm;
$desc = $hs->parse($desc);
$desc =~ s/^\r\n$//igm;