String link to rewrite.
A rewritten string if it's a compatible imgur one, else the passed url.
{ immutable directURL = "https://i.imgur.com/URHe5og.jpg"; immutable rewritten = rewriteDirectImgurURL(directURL); assert((rewritten == "https://imgur.com/URHe5og"), rewritten); } { immutable directURL = "http://i.imgur.com/URHe5og.jpg"; immutable rewritten = rewriteDirectImgurURL(directURL); assert((rewritten == "https://imgur.com/URHe5og"), rewritten); }
Takes a direct imgur link (one that points to an image) and rewrites it to instead point to the image's page.
Images (jpg, png, ...) can naturally not have titles, but the normal pages can.