diff options
-rwxr-xr-x | scripts/otp_html_check | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/otp_html_check b/scripts/otp_html_check index dc0426fc41..23805b5789 100755 --- a/scripts/otp_html_check +++ b/scripts/otp_html_check @@ -284,24 +284,28 @@ sub normalize_link { if ($link eq "") { # The empty link is a reference to URL directory return $rpath; - } elsif ($link =~ /^#(.*)$/) { + } elsif ($link =~ /^#(.*)$/s) { # Lokal reference to anchor my $anchor = $1; $anchor =~ s/%([\da-fA-F]{2})/chr(hex($1))/eg; # Translate hex to char $anchor =~ s/</</g; # $anchor =~ s/>/>/g; # + $anchor =~ s&^\s+&&; # Remove leading any whitespaces + $anchor =~ s&\s+$&&; # Remove trailing any whitespaces push(@{$anchor_refs{"$page#$anchor"}}, $page); return $page; } my $anchor = ""; - if ($link =~ s&#(.*)$&&) { + if ($link =~ s&#(.*)$&&s) { # Removed page ref (anchor) $anchor = $1; $anchor =~ s/%([\da-fA-F]{2})/chr(hex($1))/eg; # Translate hex to char $anchor =~ s/</</g; # $anchor =~ s/>/>/g; # + $anchor =~ s&^\s+&&; # Remove leading any whitespaces + $anchor =~ s&\s+$&&; # Remove trailing any whitespaces } $link = "" if $link eq "/"; |