Skip to content

[ShowImages] Imgur albums with new slug-ID URL format (imgur.com/a/slug-ALBUMID) don't expand inline #5610

Description

@af1

Description

Imgur albums in the new "slug-ID" URL format are no longer detected/expanded inline.

Example URL: https://imgur.com/a/xm2w-4k-v2-FRl5aJD
(canonical album: https://imgur.com/a/FRl5aJD, title "XM2w 4K V2")

These links used to expand inline in RES via ShowImages, but no longer do.

Cause

Imgur now serves album links as imgur.com/a/<slug>-<albumID> (e.g. xm2w-4k-v2-FRl5aJD).
In lib/modules/hosts/imgur.js, the album regex only matches a bare album ID:

const albumHashRe = /^https?:\/\/(?:m\.|www\.)?imgur\.com\/a\/(\w+)(?:[/#]|$)/i;

\w doesn't match hyphens, so the regex grabs xm2w and then fails to match the required
trailing /, #, or end-of-string — meaning the URL is never recognized as an album.
The gallery regex above it already handles this pattern via (?:.*-)(\w+$).

Proposed fix

Make the slug optional and capture the trailing album ID, mirroring the gallery handling:

const albumHashRe = /^https?:\/\/(?:m\.|www\.)?imgur\.com\/a\/(?:.*-)?(\w+)(?:[/#]|$)/i;

With this, xm2w-4k-v2-FRl5aJD resolves to album ID FRl5aJD, while plain URLs like
imgur.com/a/FRl5aJD still match. Verified against both slug and non-slug forms.

Environment

  • RES master (5.24.10)
  • Chrome

Steps to reproduce

  1. Paste/post https://imgur.com/a/xm2w-4k-v2-FRl5aJD
  2. Click the inline expand button — nothing expands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions