#166 Useless link on every line number

current_cvs
closed-fixed
Browsing (93)
3
2011-03-12
2011-03-09
No

LXR v0.9.8
File Common.pm, sub markupfile

All lines of a file can be the target of a link. For that, they are tagged with an anchor <a name=#line>#line</a>. But in the standard implementation they also contain href=(to itself) which does not make sense since we'll never need to jump from "here" to the "same place".

Getting rid of the href= will also contribute transferring less data.

Upon return &fileref(1,"fline",$pathname,1) is split in @ltag to later easily generate the tag. In the proposed change, the split is modified to "forget" the href:
instead of /^(<a)(.*\#)001(\">)1(<\/a>)$/
use /^(<a.*?)(?:href.*\#)001(\">)1(<\/a>)$/
and change accordingly @ltag
@ltag BEFORE:
0 - <a (with name= appended)
1 - class ... href="...#
2 - ">
3 - </a>
@ltag AFTER:
0 - <a class... (with name=" appended) -- double quote needed
2 - ">
3 - </a>
which sums up to:

-263,265 110226 (replace lines 263 to 265)
my @ltag = &fileref(1, "fline", $pathname, 1) =~ /^(<a.*?)(?:href.*\#)001(\">)1(<\/a>)$/;
$ltag[0] .= 'name="';
$ltag[2] .= " ";
--------------- end of patch ----------

Discussion

  • Andre-Littoz

    Andre-Littoz - 2011-03-09
    • priority: 5 --> 3
    • status: open --> open-works-for-me
     
  • Andre-Littoz

    Andre-Littoz - 2011-03-11
    • assigned_to: nobody --> ajlittoz
     
  • Andre-Littoz

    Andre-Littoz - 2011-03-12

    This has now been fixed in CVS.

    If you can install the new version and check that it solves your
    problem, then it would be very useful.

    Thanks for reporting this defect and helping to make LXR better.

     
  • Andre-Littoz

    Andre-Littoz - 2011-03-12
    • status: open-works-for-me --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks