Page MenuHomePhorge

Avoid separate per-line URIs in line number column
Needs ReviewPublic

Authored by aklapper on Thu, Apr 4, 21:20.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 20:11
Unknown Object (File)
Fri, Apr 26, 20:11
Unknown Object (File)
Fri, Apr 26, 20:11
Unknown Object (File)
Thu, Apr 25, 23:02
Unknown Object (File)
Mon, Apr 22, 13:12
Unknown Object (File)
Mon, Apr 22, 13:02
Unknown Object (File)
Wed, Apr 17, 18:28
Unknown Object (File)
Wed, Apr 17, 07:15

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Summary

Constructing a URI in the format X123$45 as the link target of line number 45 in the line number column of document X123 (resp. X123$1-10 for lines 1-10) provides the ability to highlight one or several lines, and accessing this URI highlights the corresponding lines and automatically scrolls to the highlight line(s) with 60px top margin.

The downside of using this custom JS-based approach instead of standard # HTML anchor fragments is that every URI linked from the line number column in Pastes and Diffusion file pages is semantically a separate URI to crawl (due to $ instead of # as a fragment separator).

As a compromise,

  • use standard # for the link target of each single line and when highlighting a single line. This makes us lose line highlighting and vastly reduces the number of links a crawler could follow when indexing a Paste or Diffusion file page,
  • keep using custom $ when explicitly highlighting multiple lines.

See T15670

Test Plan

Diff Detail

Repository
rP Phorge
Branch
crawl#linesDollarNo (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1152
Build 1152: arc lint + arc unit