this post was submitted on 05 Apr 2026
1 points (100.0% liked)

Lemmy

14596 readers
1 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 6 years ago
MODERATORS
 

When a code block contains syntax for an image, lemmy seems to replace the image's url with a proxied one.

This instance's web UI's preview displays the original url correctly. The proxied url is also distributed trough federation, so users on other instances or for example Piefed should also see the lemmy.ml url in the example below.

This behavior is unexpected, as the contents of a code block should not be parsed as markdown, and thus no image should be displayed and no requests to the server should be made.

Example: I entered "https://media.piefed.zip/posts/bT/UD/bTUDGZRAcKZdXyO.png" as the url in the following code block in the web UI: ![alt text](https://lemmy.ml/api/v3/image_proxy?url=https%3A%2F%2Fmedia.piefed.zip%2Fposts%2FbT%2FUD%2FbTUDGZRAcKZdXyO.png)

Lemmy UI version: 0.19.17
Lemmy backend version: 0.19.18-beta.0

you are viewing a single comment's thread
view the rest of the comments
[–] scrubbles@poptalk.scrubbles.tech 0 points 1 month ago* (last edited 1 month ago) (1 children)
[–] ferric_carcinization@lemmy.ml 0 points 1 month ago (1 children)

That doesn't explain why urls in code blocks are rewriten as well. When the image is surrounded by backticks, it shouldn't be parsed but rather displayed verbatim as the code block's content.

[–] scrubbles@poptalk.scrubbles.tech 0 points 1 month ago (1 children)

That's a fair one, could write a bug for it on GitHub

[–] ferric_carcinization@lemmy.ml 0 points 1 month ago

Sorry, but could I ask you to file the issue? I would rather not associate my social accounts with my real identity.

I probably should have filed an issue to begin with.