The discussion revolves around an issue with image links in cooked content on a Discourse platform. avaldez reported that custom image links are being replaced with a “broken image” span during the cooking process, despite being valid. Arkshine suggested checking the “block hotlinked media” setting, but avaldez couldn’t find it in the UI.
After sharing their Discourse version (2.4.0.beta6) and image tag format, avaldez eventually found a solution: including the hostname in the image link. This prevents Discourse from modifying the img elements in the cooked version, even if it can’t access the resource. avaldez thanked Arkshine for their help.
Hi guys, I’m having issues with the cooked content of posts with images.
The thing is that we are using a custom link for images looking like: /api/v1/discourse/custom/link/hash_id/filename.png
Everything good when the post is created, but there’s a point while discourse is cooking that post html, that detects that this link is “broken”, so it replaces it’s content with a <span> like the following:
The solution to this issue was to include the hostname for the image, to have the full link. That way, even if discourse doesn’t have access to the resourse, it is not messing with img elements in the cooked version.