From: Nicolas Boisselier Date: Sat, 8 Jul 2023 22:12:34 +0000 (+0200) Subject: html2txt links X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=0db0888fd7a671cb230738499ddadd0d47bed470;p=nb.git html2txt links --- 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