Whilst testing the new RC I've noticed that screenshots in the description of #30 aren't being displayed, but a later screenshot in the comments is.
assigned to @btasker
changed the description
Looking in developer tools, I'm seeing different paths between working and not working:
/uploads/1e7e6db836499d02dc2b7f8dc80218d0/Screenshot_20220421_082234.png
/issue/websites/Gitlab-Issue-Listing-Script/uploads/a153685e3a5014d1eb5125bf1aa2a050/Screenshot_20220421_195659.png
The path in the comments is relative, whilst the one in the description is absolute:
<img src="uploads/a153685e3a5014d1eb5125bf1aa2a050/Screenshot_20220421_195659.png" alt="Screenshot_20220421_195659"> <img src="/uploads/1e7e6db836499d02dc2b7f8dc80218d0/Screenshot_20220421_082234.png" alt="Screenshot_20220421_082234">
We handle images from within their relevant subsection, so it does need to be relative.
Looking at the markdown that Gitlab's API returns for the issue description, the path is absolute there.
![Screenshot_20220421_082234](uploads/1e7e6db836499d02dc2b7f8dc80218d0/Screenshot_20220421_082234.png)
Interestingly though, the same is true of the one in the comments
![Screenshot_20220421_195659](uploads/a153685e3a5014d1eb5125bf1aa2a050/Screenshot_20220421_195659.png)
Ah, comments have some additional processing which the issue description does not
$body = str_replace("](uploads", "](uploads", $body);
I don't remember doing that, but there's our answer.
mentioned in commit 61a6f2a705d0de3d8f1016d4c36d595b52b157bc
Commit: 61a6f2a705d0de3d8f1016d4c36d595b52b157bc Author: B Tasker Date: 2022-04-22T08:40:05.000+01:00
Images within issue descriptions were broken (websites/Gitlab-Issue-Listing-Script#32)
This commit adjusts so that the path is always relative.
We might actually want to make this DRY and build a utility function for handling image embeds
Activity
22-Apr-22 07:24
assigned to @btasker
22-Apr-22 07:24
changed the description
22-Apr-22 07:28
Looking in developer tools, I'm seeing different paths between working and not working:
/uploads/1e7e6db836499d02dc2b7f8dc80218d0/Screenshot_20220421_082234.png
/issue/websites/Gitlab-Issue-Listing-Script/uploads/a153685e3a5014d1eb5125bf1aa2a050/Screenshot_20220421_195659.png
The path in the comments is relative, whilst the one in the description is absolute:
We handle images from within their relevant subsection, so it does need to be relative.
22-Apr-22 07:38
Looking at the markdown that Gitlab's API returns for the issue description, the path is absolute there.
Interestingly though, the same is true of the one in the comments
Ah, comments have some additional processing which the issue description does not
I don't remember doing that, but there's our answer.
22-Apr-22 07:41
mentioned in commit 61a6f2a705d0de3d8f1016d4c36d595b52b157bc
Message
Images within issue descriptions were broken (websites/Gitlab-Issue-Listing-Script#32)
This commit adjusts so that the path is always relative.
We might actually want to make this DRY and build a utility function for handling image embeds