Skip to content

Fix linkify-line-numbers table layout regression#9530

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-linkify-line-numbers
Closed

Fix linkify-line-numbers table layout regression#9530
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-linkify-line-numbers

Conversation

Copilot AI commented May 19, 2026

Copy link
Copy Markdown
Contributor

linkify-line-numbers could break GitHub’s diff table structure by replacing the line-number <td> with an <a>, which made the number jump out of place on slower loads. This change keeps the cell intact and only linkifies its contents.

  • DOM structure

    • Preserve .blob-num table cells and append an anchor inside the cell instead of replacing the cell node.
    • Keep permalink generation unchanged for both blob links and PR diff links.
  • Hardening

    • Move the line-number linkification logic into a dedicated helper.
    • Raise an explicit error if the surrounding diff container does not expose the expected file permalink.
  • Regression coverage

    • Add a focused test for both PR diff permalinks and blob permalinks.
    • The resulting structure is now:
<td class="blob-num" data-line-number="287">
	<a class="d-block no-underline Link--onHover" href="/refined-github/refined-github/pull/9510/files#diff-testR287">287</a>
</td>

Test URLs

Screenshot

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue May 19, 2026 that may be closed by this pull request
1 task
Copilot AI and others added 2 commits May 19, 2026 15:26
Copilot AI changed the title [WIP] Fix linkify line numbers moving the number to the top Fix linkify-line-numbers table layout regression May 19, 2026
Copilot AI requested a review from fregante May 19, 2026 15:35
@fregante fregante closed this May 19, 2026
@SunsetTechuila SunsetTechuila deleted the copilot/fix-linkify-line-numbers branch May 19, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

linkify-line-numbers moving the number to the top

2 participants