Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: Range state from url #338

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fstachura
Copy link
Collaborator

Fixes #329

Important changes that should make reading the diff easier:
* Script now only works on line numbers. Elements are queried when
  necessary
* handleLineRange was refactored into functions that only validate and
  return line number(s), it's now the callers responsibility to
  highlight the range
@tleb
Copy link
Member

tleb commented Oct 11, 2024

If we modify the URL bar and change the anchor, the webpage does not update. Is that expected? Do we have events accessible for that?

Example:

  • Go to /linux/v6.11.3/source/MAINTAINERS#L43-L55;
  • Edit URL bar to be /linux/v6.11.3/source/MAINTAINERS#L43-L60 (notice the 55 changed to 60);
  • Result: no change on the page. Firefox does not reload the page.

@fstachura
Copy link
Collaborator Author

If we modify the URL bar and change the anchor, the webpage does not update. Is that expected?

I guess

Do we have events accessible for that?

If you find this valuable, there is a hashchange event that can be used to update range if someone types a hash manually

@fstachura
Copy link
Collaborator Author

@tleb Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

range anchors: allow selecting when arriving on page with single-line anchor
2 participants