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
- Paste/post
https://imgur.com/a/xm2w-4k-v2-FRl5aJD
- Click the inline expand button — nothing expands.
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:\wdoesn't match hyphens, so the regex grabsxm2wand then fails to match the requiredtrailing
/,#, 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:
With this,
xm2w-4k-v2-FRl5aJDresolves to album IDFRl5aJD, while plain URLs likeimgur.com/a/FRl5aJDstill match. Verified against both slug and non-slug forms.Environment
Steps to reproduce
https://imgur.com/a/xm2w-4k-v2-FRl5aJD