From 0db0888fd7a671cb230738499ddadd0d47bed470 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sun, 9 Jul 2023 00:12:34 +0200 Subject: [PATCH] html2txt links --- lib/perl/NB/Functions.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/perl/NB/Functions.pm b/lib/perl/NB/Functions.pm index 7146358b..8e7c6b64 100644 --- a/lib/perl/NB/Functions.pm +++ b/lib/perl/NB/Functions.pm @@ -557,10 +557,16 @@ sub html2txt { ( \\n ) ,\n,gix; + # Links + $v =~ s, + ]+href="([^"]+)"[^>]*>([^<]+) + ,$2 ( $1 ),gix; + # Delete $v =~ s,(^_DUMMY_$) # never happend only for easy regexp change order |( ) # condition + |( ) # comment |( ]*>.*? ) # style |( ]*>.*? ) # noscript @@ -581,6 +587,7 @@ sub html2txt { ,,sgix; # NB 03.07.23: Multiple empty nosy lines + #$v =~ s/([ \t\r]*\n){2}([ \t\r]*\n)*/$1/sg; $v =~ s/\n(\s*\n)+/\n/sg; # Mutiple tabs -- 2.47.3