project Websites / Gitlab Issue Listing Script avatar

websites/Gitlab-Issue-Listing-Script#20: Add support for images in Wikis

Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.3
Created: 17-Apr-22 08:52


Currently images won't be picked up on in the markdown and so the placeholder will be displayed instead.

Need to look at how they get returned and rewrite them so that they work.

Issue Links

Toggle State Changes


assigned to @btasker

OK, so the image link does come through in the markdown:

The domain `` is configured to point to it ![IMG_20220410_224836](uploads/e66ce282ecc4d630ccbe798f4fa07e0f/IMG_20220410_224836.jpg)

So, we probably just need to catch that and redirect it to the right place.

This was implemented (a while back) for images in issues, so might be possible to re-use the code from that.

In fact, it looks like it's easier than that.

The image is correctly converted to an image tag, we just need the router to be able to handle it.

For issues we have a check to see if we're looking for uploads:

            case "issue":
                if ($path_split[4] == "uploads"){
                    // It's an image request
                    return array(
                        "section" => "issue",
                        "subsection" => implode("/",array($path_split[2], $path_split[3])),
                        "issid" => false,
                        "img_path" => implode("/",array_slice($path_split, -3)),
                        "sef" => $sef                        

                return array(
                    "section" => "issue",
                    "subsection" => implode("/",array_slice(array_slice($path_split, -3),0, 2)),
                    "issid" => end($path_split),
                    "sef" => $sef                        

We just need to implement similar for the wiki section


mentioned in commit 60fc65e5b9b977c4b2126a10c7da7064bec49f64

Commit: 60fc65e5b9b977c4b2126a10c7da7064bec49f64 
Author: B Tasker                            
Date: 2022-04-18T10:45:14.000+01:00 


Enable support for images in wiki pages for websites/Gitlab-Issue-Listing-Script#20

+19 -3 (22 lines changed)

marked this issue as related to #4

mentioned in issue #4