• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Force image to be on own line

Floyd R Turbo

Well-known member
#1
I don't know if this is even remotely possible, but it's one thing that I've found rather annoying.

Whenever someone posts a picture, whether that be an attachment or a IMG code BB link, etc, there are some people that don't understand that unless you actually hit return before and after the picture, their post will look like a jumbled mess with the text preceding the pic/thumb inline or running on right after it.

So is there any way to automatically force an image to be on it's own line? Without messing up a bunch of other stuff?

I think this is mainly a "user education" thing but it really surprises me how many people don't seem to get this simple process for making a post look clean and readable.
 

Chris D

XenForo developer
Staff member
#3
If you're accepting of the repercussions as outlined above by Robust then you can handle this with CSS. EXTRA.css:

Code:
.messageContent .messageText img
{
    display: block;
}
You could also add some more code here to give it a bit of spacing.
 

Floyd R Turbo

Well-known member
#4
Yeah I had considered that @Robust and that is definitely not something I would want to happen. That wouldn't be an issue with XF built in smilies though.

I was thinking of a way to maybe make it a "smart" filter. For instance, code that would be able to process BB code of only a certain structure. Like the word ATTACH for XF attachments, or something that looks for IMG code but only from certain sites like photobucket or dropbox or shutterfly, things that would most prevalently be photos.
 

Brogan

XenForo moderator
Staff member
#5
Sounds like a very niche function to me.

I definitely wouldn't want post content on my site manipulated in that manner.
 

Robust

Well-known member
#6
Yeah I had considered that @Robust and that is definitely not something I would want to happen. That wouldn't be an issue with XF built in smilies though.

I was thinking of a way to maybe make it a "smart" filter. For instance, code that would be able to process BB code of only a certain structure. Like the word ATTACH for XF attachments, or something that looks for IMG code but only from certain sites like photobucket or dropbox or shutterfly, things that would most prevalently be photos.
I think a more suitable way to do it would be to check if the image height is larger than the height of that row of text, so if you have increased text size it'd check it against that, otherwise against the normal size. If it's larger than put it onto a new row automatically. I think that's a friendly way to do it, that is if this got implemented.
 

Floyd R Turbo

Well-known member
#8
I definitely wouldn't want post content on my site manipulated in that manner.
I wondered if you had mis-typed this originally (as "would")

What would the reason be for why you would not want to have this done, just out of curiosity?

This thread may be better placed in the addon requests sub-forum, if anyone can move it for me that would be appreciated