Skip to content

use the HTML “rel” attribute for ]] and [[ #668

Open
@Maelan

Description

@Maelan
Issue type:
  • Feature request
Description:

the current implementation of ]] / [[ (go to next / previous page — extremely useful) uses an ad hoc heuristics: a regex (option 'nextpattern' / 'prevpattern') to find a link to a potential next / previous page. this works on some pages but does not catch everything, so one can only hope it works on its favorite website (in my experience this is seldom the case of non‐English‐speaking website). you can try and patch the regexes, but well…

good news: there exists a HTML attribute for that very purpose. this is called rel and can be given to <link> and <a> tags (doc for <link> and for <a>). so, provided a page uses it, we can find the relevant URL much more easily, and without risk of error.

Expected behavior:

]] / [[ should:

  1. first look for a <link href="URL" rel="next/prev"/> tag in the HTML head;
  2. if not, look for a <a href="URL" rel="next/prev"> tag in the body;
  3. if not, look for a <a href="URL"> tag in the body with the link text matching 'nextpattern' / 'prevpattern' (the current behaviour).
Final note:

did i say how useful this feature is? :-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions