From: Wolfgang Bangerth Date: Sun, 31 Oct 2004 23:17:46 +0000 (+0000) Subject: Allow multiline hrefs. X-Git-Tag: v8.0.0~14730 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f195f67fe658ca08f6451f51211aac85d478c3b9;p=dealii.git Allow multiline hrefs. git-svn-id: https://svn.dealii.org/trunk@9742 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/scripts/validate-xrefs.pl b/deal.II/common/scripts/validate-xrefs.pl index 4c5c56f4bd..c201112bed 100644 --- a/deal.II/common/scripts/validate-xrefs.pl +++ b/deal.II/common/scripts/validate-xrefs.pl @@ -24,6 +24,19 @@ foreach $filename (@ARGV) } while () { + # save the entire line for simpler grepping when an error + # occurs + $this_line = $_; + + # if line ends with an = character, the concatenate it with the next + # one + while ( /=\s*$/ ) { + $newline = ; + $newline =~ s/^\s*//g; + $_ = $thisline . $newline; + $this_line = $_; + } + # first find all hrefs while ( /<\s*a\s+href=\"?(.*?)[\s\"]/gi ) { # then decide whether they are relevant for @@ -54,7 +67,7 @@ foreach $filename (@ARGV) } } - die "---Internal reference `$internal_ref' not found in file $filename\n" + die "---Internal reference `$internal_ref' not found in file $filename\n This line is: $this_line.\n" unless $found; next; } @@ -83,7 +96,7 @@ foreach $filename (@ARGV) } } - die "---External reference `$external_file#$external_ref' not found in file $filename\n" + die "---External reference `$external_file#$external_ref' not found in file $filename\n This line is: $this_line.\n" unless $found; next; } @@ -95,7 +108,7 @@ foreach $filename (@ARGV) # so no double-slash), then split off http: $link =~ s/^http://g; - die "---Local file `$link' not found in file `$filename'\n" + die "---Local file `$link' not found in file `$filename'\n This line is: $this_line.\n" unless ((-r $link) && (-f $link)); } } @@ -105,7 +118,7 @@ foreach $filename (@ARGV) # check whether the file for the image is present $link = $1; - die "---Local image `$link' not found in file `$filename'\n" + die "---Local image `$link' not found in file `$filename'\n This line is: $this_line.\n" unless ((-r $link) && (-f $link)); } }