I have seen this confusion on a lot of Discourse sites @eviltrout.
I wonder if this should even be a setting? How often do you want to paste an image without a new paragraph? Perhaps the behaviour should change to always do this.
Sometimes I like to align images right or left, or insert a bunch of images and resize them to 50% so they look like a pretty photo gallery. In these cases I would not want to have them all in their own paragraph.
Not sure how many people do this or care about this, compare to the known large number of people who get confused by how it works now. Markdown is still confusing to many folks.
Rare use cases, we should not be optimizing for this, but the common use case.
To add, when you upload multiple images at once (on iOS at least) it inserts them with only a space between them, so I always have to go back to add new lines.
And for a while we did not even add the space!!
I find my users often upload multiple images at once only to screw up the post when they try to add a caption below an image, or when they remove the starting !
by mistake. Adding two new lines after each upload would be very useful. Any progress on this?
Yes we should pick this up again. Might be an easy one we can slip into the release… @andrei ?
It’s implemented as default behavior, not as a setting. When uploading images from a device:
- we add a newline before an image if a cursor is on a nonblank line
- we always add a newline after images
- we add a newline between images when uploading several images
The important detail is that we always add one, not two newlines.
It’s merged now:
https://github.com/discourse/discourse/pull/12895
This is a nice improvement!
Quick (untested) thought: does this cause problems for theme components that try to display images in a grid? For example Tiles Image Gallery or Masonry Image Gallery?
As far as Masonry Image Gallery, this isn’t a problem. It’s coded to handle newlines and paragraphs.
Nice merge!
I’m curious about this. From a ux perspective, a space between uploaded images makes more sense to me.
No space as uploaded:
With space added:
I think it’s fine as is. We can revisit later as this is exceedingly minor.
Unfortunately, this causes problems for Tiles Image Gallery. I’ve checked it, it can handle only images separated with spaces, not newlines.
I may take a look at this next week.
Yeah, I have never uploaded multiple images without the blank line in between the images. I always add the extra line myself.
It’s good with a single new line. Easy to adjust with CSS.
.cooked img {
margin-bottom: 3px;
}
And don’t forget, if you want to adjust the preview you need to do something like this.
.d-editor-preview img {
margin-bottom: 3px;
}
Here is the fix for Tiles Image Gallery