validator/httpd/cgi-bin check,1.305.2.110,1.305.2.111

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv15684

Modified Files:
      Tag: validator-0_6_0-branch
	check 
Log Message:
Link from error line numbers to source only if we're showing the source.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.305.2.110
retrieving revision 1.305.2.111
diff -u -d -r1.305.2.110 -r1.305.2.111
--- check	7 May 2004 18:11:02 -0000	1.305.2.110
+++ check	8 May 2004 17:10:41 -0000	1.305.2.111
@@ -1904,8 +1904,12 @@
 
       my $msg = &ent($err->{msg}); # Entity encode error message.
 
+      # Link from line numbers to source iff we're showing it.
+      my $linenr = $File->{'Opt'}->{'Show Source'} ?
+        qq(<a href="#line-$err->{line}">$err->{line}</a>) : $err->{line};
+
       print ' ' x 8; # Indent markup...
-      print qq(<li><p><em>Line <a href="#line-$err->{line}">$err->{line}</a>, column $err->{char}</em>: );
+      print qq(<li><p><em>Line $linenr, column $err->{char}</em>: );
       print qq{<span class="msg">$msg</span></p>};
       print qq(<p><code class="input">$line</code></p>);
 

Received on Saturday, 8 May 2004 13:11:33 UTC