Revert modification to link lines #5
@@ -471,16 +471,13 @@ sub is_path_index{
|
||||
sub add_page_link{
|
||||
my $linkline = shift;
|
||||
my $base_url = shift;
|
||||
#my $link=~ /^=>[ ]+([^ ]*)/
|
||||
my $link = $linkline;
|
||||
my $uri_object;
|
||||
|
||||
$link=~ s/^=> ([^ ]*)/$1/; #remember inside of braces, ^ means NOT, so any NOT SPACE letters are selected, so everything up to next space
|
||||
#my $link=~ s/^=>[ ]*(.*$)/$1/r;
|
||||
local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1;
|
||||
local $URI::ABS_REMOTE_LEADING_DOTS = 1;
|
||||
if (defined($link)){ #has to be something here or I think URI->new_abs has exception that crashes app
|
||||
$uri_object=URI->new_abs($link,$base_url);
|
||||
#remember inside of braces, ^ means NOT, so any NOT SPACE letters are selected, so everything up to next space
|
||||
if (defined($linkline=~ /^=> ([^ ]*)/)){ #has to be something here or I think URI->new_abs has exception that crashes app
|
||||
$uri_object=URI->new_abs($linkline=~ /^=> ([^ ]*)/,$base_url);
|
||||
push(@page_links, $uri_object->as_string);
|
||||
my $count = scalar @page_links; #scalar is size/count of links, but $#page_links is highest INDEX
|
||||
#return $linkline =~ s/(^=>.*$)/$1 [\>$count\]/r; don't need to escape on the replace part of a substitution, I guess?
|
||||
|
||||
Reference in New Issue
Block a user