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 33875dd1e6936d33e97dfaca4c2f82c92558034a
parent 70dfde6e6d1bc071379528ff85e97452ba341a7e
Author: René Wagner <rwagner@rw-net.de>
Date:   Thu, 26 Nov 2020 21:16:52 +0100

convert lists to gemtext

convert li-tags to gemtext lists

Diffstat:
MREADME.md | 1+
Morrg.pl | 6++++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md @@ -11,6 +11,7 @@ The demo might break regularly as i use it for integration testing during develo - load an atom/rss feed from http(s) given by user input - render feed (channel info & entrys) as a gemini site - include links to originating site and every article + - strip html tags from item description Fetching feeds from gemini is currently not supported -> https://todo.sr.ht/~rwa/gmni-perl/4 diff --git a/orrg.pl b/orrg.pl @@ -72,6 +72,7 @@ sub create_response $feed->link eq '' or push @body, ('=> '.$feed->link.' open website', ''); push @body, ('## recent feed items', ''); + my $hs = HTML::Strip->new(emit_spaces => 0, auto_reset => 1); foreach my $it ($feed->get_item()) { push @body, '### '. $it->title; if ($it->pubDate ne '') { @@ -80,8 +81,9 @@ sub create_response } push @body, ''; if ($it->description ne '') { - my $hs = HTML::Strip->new(); - push @body, $hs->parse($it->description); + my $desc = $it->description; + $desc =~ s/\<li\>/* /ig; + push @body, $hs->parse($desc); } $it->link eq '' or push @body, ('=> '.$it->link.' open entry in browser', ''); }