The mixed content warnings were bugging me, so I looked at the code in order to fix this. Unfortunately there’s more than one reason why images within oneboxes aren’t downloaded.
I’ll at least try to document my findings:
As @zogstrip mentioned images inside oneboxes should be ignored. But they aren’t since the
doc.css(".onebox-result img")doesn’t do anything. Is the
onebox-resultclass still used? I saw only
onebox-bodywhen I included Github and whitelisted oneboxes.
Discourse downloads all the images embedded in oneboxes, but many of the embedded images have no recognizable file extension.:
- Gravatar used at Stackoverflow:
- Avatar used at Github:
- Discourse looks only at the file extension and since it doesn’t find a known image extension, it stores it as simple upload, not as image.
- If we are lucky and the image embedded in the onebox has a valid image file extension, we run into the last problem. Image URLs are only replaced within the post’s
rawtext, but the onebox images aren’t there. They are stored in