[Lxr-dev] [ lxr-Bugs-3204096 ] Useless link on every line number
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2011-03-09 14:11:07
|
Bugs item #3204096, was opened at 2011-03-09 13:14 Message generated for change (Settings changed) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204096&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Browsing Group: current cvs Status: Open >Resolution: Works For Me >Priority: 3 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Nobody/Anonymous (nobody) Summary: Useless link on every line number Initial Comment: 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 ---------- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204096&group_id=27350 |