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

Next/previous page heuristic is wrong for DokuWiki #4578

Open
sersorrel opened this issue Nov 24, 2024 · 0 comments
Open

Next/previous page heuristic is wrong for DokuWiki #4578

sersorrel opened this issue Nov 24, 2024 · 0 comments

Comments

@sersorrel
Copy link

Describe the bug

If you use the blog plugin for DokuWiki, you get links saying "<< Newer entries" and "Older entries >>". This would be fine, except that the default DokuWiki theme also includes links labelled "Backlinks" and "Back to top". Since "Backlinks" is more than one word shorter than "Older entries >>", and due to a separate bug described below "Back to top" is treated the same, trying to go to the previous page incorrectly discards the real candidate links, so you get sent to the top of the page rather than the older blog posts.

The aforementioned bug is in the wordCount calculation – if a link is chosen as a candidate because its title or aria-label looks good, but its innerText is empty, then it will get a wordCount of 1, and thus be unfairly chosen over other candidates. (Here, the "Back to top" link would not be chosen if the wordCount was calculated correctly; instead "Backlinks" would be selected.)

I can see a few possibilities that might help to address the imperfect heuristic:

  • reduce the degree by which link length matters (e.g. permit differences of two words in length, not just one)
  • apply word-boundary matching (exactWordRegex) before picking the maximum word length
  • additionally score candidates by the number of times they match against linkStrings

As a workaround, I have removed "back" from "Previous patterns" in my Vimium preferences.

To Reproduce

Steps to reproduce the behavior:

  1. Go to URL https://keysmash.solutions/
  2. Press [[
  3. Observe that you are sent to https://keysmash.solutions/#dokuwiki__top, rather than https://keysmash.solutions/index?first=5

Browser and Vimium version

  • Firefox 132.0.2
  • NixOS 25.05.20241119.23e89b7 (Linux 6.6.62)
  • Vimium 2.1.2
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

No branches or pull requests

1 participant