summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/otp_html_check8
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/&lt;/</g; #
$anchor =~ s/&gt;/>/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/&lt;/</g; #
$anchor =~ s/&gt;/>/g; #
+ $anchor =~ s&^\s+&&; # Remove leading any whitespaces
+ $anchor =~ s&\s+$&&; # Remove trailing any whitespaces
}
$link = "" if $link eq "/";