I see this in both posts and comments. Unless a new line is inserted between each image link, then the formatting of each image gets worse and worse. I've had this issue for ages, but never had a bad enough post before to get this bothered by it.

Link to the post: https://lemmy.world/post/53478299

The post is formatted something like this:

!{imgURL1} !{imgURL2} !{imgURL3} !{imgURL4}

But would need to be formatted like this to view properly:

!{imgURL1}

!{imgURL2}

!{imgURL3}

!{imgURL4}

Here's a full screenshot of the post:

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 day ago* (last edited 1 day ago)

Pretty tough bug. Basically this is due to inline images.

In markdown when you post images inline without line breaks the renderer needs to make a decision on how to render the image.

In an ideal world this happens via 2 layout passes. The first pass checks to see how many images inline can fit per line. The 2nd render pass, images are stretched to take up the entire width of the view.

Android doesn't have native markdown support so markdown is implemented in a very hacky way. There is no multiple layout passes basically.

What a lot of apps do to resolve this issue is to just disable inline images entire. If an image is seen it is always rendered full width. This is trivial to implement and would "solve" this bug. The issue is that Lemmy also supports "emojis". Emojis are just images inline in markdown. Emojis generally would not work with this workaround.

I am going to implement a slight workaround. Basically if I can tell that an image is going to take up the entire width I'm going to make the image take up the full width. If not then it will be inline but the bug will still occur.

Edit: This update I'm working on emojis so I can see if there is a better trade off here once everything is said and done.

  • source