Post formatting questions

11 Replies, 1844 Views

Does anyone know why posts tend to create extra spaces between what you include in your posts - text, images, videos, quotes? No matter how you try to squeeze them tightly together, the formatting seems to want to create extra spaces.
[-] The following 1 user Likes Ninshub's post:
  • Doug
(2018-06-24, 07:32 PM)Ninshub Wrote: Does anyone know why posts tend to create extra spaces between what you include in your posts - text, images, videos, quotes? No matter how you try to squeeze them tightly together, the formatting seems to want to create extra spaces.

Thanks for raising this issue, Ian. I don't have an answer for you, except to say that occasionally there are no spaces between text and the other elements of posts. To me, that's almost as bad as having too much space.

This near-constant mis-spacing between text and videos/images/quotes/links is for me the most annoying bug by far in the MyBB software. I think it's appalling that it wasn't fixed for the last release. I can't tell you how much time I've wasted correcting mis-spaced posts...
(This post was last modified: 2018-06-24, 08:05 PM by Doug.)
[-] The following 1 user Likes Doug's post:
  • Ninshub
Yeah it's annoying as hell. I always re-edit posts because of it but they still come out badly displayed...
(2018-06-24, 08:41 PM)Ninshub Wrote: Yeah it's annoying as hell. I always re-edit posts because of it but they still come out badly displayed...

Sometimes you have to eliminate all spaces between the text and objects before introducing a space. And by "all spaces", I mean you need to delete not only the spaces you see, but one space that you can't see. If done correctly, you won't delete the object in question, but will be assured that there really is no space left between it and the text above or below it. Once that's done, you add a space, then preview your post.
[-] The following 1 user Likes Doug's post:
  • Ninshub
(2018-06-24, 08:49 PM)Doug Wrote: And by "all spaces", I mean you need to delete not only the spaces you see, but one space that you can't see.
Yeah I've encountered that conundrum, and I usually give up at that point.
[-] The following 1 user Likes Ninshub's post:
  • Doug
Re "that one space that you can't see" (assuming you mean within text), it generally (always?) becomes visible when you switch to "View source" mode (the lined-piece-of-paper icon to the far right of the editing toolbar). Re the rest of the spacing issues, I agree that they're annoying and am not sure what causes them. The ones that bug me the most are with respect to lists, which seem to have extra spaces created above and below them.
[-] The following 2 users Like Laird's post:
  • Ninshub, Doug
(2018-06-25, 11:25 AM)Laird Wrote: The ones that bug me the most are with respect to lists, which seem to have extra spaces created above and below them.

OK, turns out this one only occurred for numbered lists, and only created an extra space above the list. It was a pretty simple fix: remove the beginning "\n" (code for newline) in the quoted string on line 1583 of inc/class_parser.php. [Edit: actually, that had no effect, and it turns out that the vertical spaces before and after lists are just the way the HTML renders by default. Carry on; nothing to see here.]

If we can identify all of the other cases like this, we can (hopefully just as easily) fix them all and then submit a patch to the MyBB developers - so feel free, next time you notice an unwanted space,  to post here the conditions under which it occurs, and, optionally, the fix if you feel like digging into the code, otherwise I'll suss that out for us.
(This post was last modified: 2018-07-03, 11:44 PM by Laird.)
[-] The following 3 users Like Laird's post:
  • Ninshub, Typoz, Doug
(2018-06-24, 07:32 PM)Ninshub Wrote: Does anyone know why posts tend to create extra spaces between what you include in your posts - text, images, videos, quotes? No matter how you try to squeeze them tightly together, the formatting seems to want to create extra spaces.

Have found a more general solution than the one above for lists - it can be applied to videos too. Haven't been able to replicate the problem for quotes and images though - are you sure those are affected, Ian? As for text, the problem of which I'm aware (as I mentioned above) is that the visual editor sometimes inserts extra spaces, which can be removed by going into "View source" mode - are there any other problems you've noticed?

The question now is whether to implement this solution given that you and others have been working around the problem by removing spaces before/after videos: if/when we implement the solution, those spaces in existing posts will really disappear, and we will have created a new problem of text squashed up vertically against videos!
The problem I encounter is extra text before and after videos, and before and after putting text in quotes, but especially the former. I haven't studied the problem enough to be able to answer your questions, though. I just notice I can't get it to do as I intend, no matter what I try to edit and bunch up together. BTW, I also can't find the "View source" mode.

It's a problem I can live with, though, so don't make your life difficult trying to change it - I was just wondering if there was an easy fix.
(This post was last modified: 2018-07-01, 03:50 PM by Ninshub.)
(2018-07-01, 03:49 PM)Ninshub Wrote: The problem I encounter is extra text before and after videos, and before and after putting text in quotes, but especially the former. I haven't studied the problem enough to be able to answer your questions, though. I just notice I can't get it to do as I intend, no matter what I try to edit and bunch up together.

OK. Well, I can fix the video problem, although as I said the fix would "break" posts that have been using a workaround (removing blank lines) for the problem. Maybe though I can code a little tool to reinsert blank lines where necessary in existing posts after applying the fix, to minimise the breakage.

(2018-07-01, 03:49 PM)Ninshub Wrote: BTW, I also can't find the "View source" mode.

Oh, it's here (orange circle) or you might be able to get to it by pressing ctrl+shift+S, and this is what it looks like when you're in it:

   
[-] The following 3 users Like Laird's post:
  • Doug, Typoz, Ninshub

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)