Can't copy HTML from jpeg uploads

I had a similar bug, see here. In my case it turned out the “jpeg” was actually a heic, and that file format wasn’t handled properly, not even after renaming the file extension to jpg.