Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Unexpected results formatting code using [code]...[/code]

tprelog

Contributor
Joined
Mar 2, 2016
Messages
150
I'm having trouble with code formatting while creating a resource

Here are 2 lines of code. Here it is displayed with no line wrap but the code box still wasting much space with empty lines.
I thought these used to size to only the needed height for the code they contain?

Code:
wget -O /tmp/pkglist.json https://raw.githubusercontent.com/tprelog/iocage-homeassistant/master/pkg-list.json
sudo iocage create -r 11.2-RELEASE boot=on dhcp=on bpf=yes vnet=on -p /tmp/pkglist.json -n homeassistant


When I post the exact same code in my resource description things are even worse
This screenshot show what I mean

1546792669300.png


Not only does look horrible, it appears there are 4 commands - when in fact it's only 2!
I have checked forum's BB Code reference but found nothing to fix these issues.

Can somebody please help me fix this or link to a possible solution?
Thanks
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,085
Here are 2 lines of code. Here it is displayed with no line wrap but the code box still wasting much space with empty lines.
I thought these used to size to only the needed height for the code they contain?
Just a few weeks ago, the forum software was upgraded. When that happened, some behavior changed and it has not all been straightened out yet. It is true, the box that holds code used to have a working horizontal scroll bar so that long lines did not word-wrap AND they vertically scaled to fit the content if the content was short or allowed a limited number of lines to be displayed before truncating and requiring use of a vertical scroll bar to see the remaining text.
Not only does look horrible, it appears there are 4 commands - when in fact it's only 2!
I have checked forum's BB Code reference but found nothing to fix these issues.
It is not that you are doing something wrong, the forum software needs some tweaking and we can only be patient and hope that it gets corrected.
I hope you will do your best to make the resource in the way it should be made so that when the forum software is configured properly, your resource will display correctly.
Thank you for your contribution.
 

tprelog

Contributor
Joined
Mar 2, 2016
Messages
150

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
17,844

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
874
It took a moment to find where the problem occurred, had to open the 'iocage plugin-jail' spoiler nested within the initial 'WIP' spoiler.

This issue does not appear for Ganz großes Kino -dark which means it should be a simple adjustment to the CSS of the New Style theme, and I will make the adjustment shortly if it has not been fixed already (and add comments to delineate/identify it).

For future concerns, especially those which could be corrected by adjustments to themes, it would be helpful to know:
  1. Specific location including where in the post/resource and how to get to it (especially if nested in spoilers/quotes),
  2. viewport size,
  3. chosen theme,
  4. and browser.
I think those details should help track down what needs to be changed. If there are others, please add to the list.
 

tprelog

Contributor
Joined
Mar 2, 2016
Messages
150
@Tigersharke

Thanks for taking care of this. Sorry I'm still reformatting that resource from another forum. Won't be so much nesting when I'm finished.
I didn't realize someone would need to go look. I will keep in mind in to better describe the location in future though.

To answer remaining questions

1. Will do in the future
2. 2560 × 1270
3. New Style
4. Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)

Thanks again
 

tprelog

Contributor
Joined
Mar 2, 2016
Messages
150
That was fast! Looks much better now
1546831405169.png

@Tigersharke

Thanks Again
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
17,844
@Tigersharke: Some users have noted that the old behavior (grow up until a certain size and then stop growing and add a scrollbar) was better than the current one, which seems to grow indefinitely. Is this something easily fixed?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,085
Also, this behavior:
1546893431621.png

Which appeared to be fixed last night when using Chrome, is not working properly on Firefox.
 

JoshDW19

Community Moderator
Administrator
Moderator
iXsystems
Joined
May 16, 2016
Messages
1,040
Looks like Tigersharke accidentally commented out my code block height fix :P. I'll try setting a max-height value and see if that kills two birds with one stone.
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
17,844
Seems to be okay now, except that it's missing the background and the orange bar to the left in the staff area (possibly elsewhere). Outside of there, it looks fine as far as I can tell...
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
874
@Tigersharke: Some users have noted that the old behavior (grow up until a certain size and then stop growing and add a scrollbar) was better than the current one, which seems to grow indefinitely. Is this something easily fixed?
The "scrollbar effect" in CSS at most simplest can be two things "overflow: auto" or "overflow: scroll" and according to w3schools
  • auto is "If overflow is clipped, a scroll-bar should be added to see the rest of the content" -- This I believe is adaptive, the scroll-bar appears as needed.
  • scroll is "The overflow is clipped, but a scroll-bar is added to see the rest of the content" -- I take this to mean that there is *always* a scroll-bar region present.
There may be some "stepped" viewport sizes which may change the effect or supercede individual changes. I know the older XenForo used this stepped method to adapt to sizes and it appears there may be some in the 2.0 version as well. The newer method is "flex" or "flex-" properties is also used. I did nothing to remove the bar or change its color, so I cannot speak to that.

After I commented-out the block height fix, things seemed to look correct in New Style so I thought I was done. Many issues are already solved in my Ganz großes Kino theme so it takes a little effort to compare the two themes as well as to pinpoint how any modifications were different (or missing). If things are working as desired now, thats fine. I commented out some things with an explanation rather than removing them completely because sometimes you hit upon a solution but maybe use the wrong value. If its erased entirely but the adjustment is still needed later then one would need to re-discover the solution which can be a pain.

I use Firefox (firefox-64.0_3,1) via FreeBSD desktop with a rather large screen (1600x1200 or so).
 

tprelog

Contributor
Joined
Mar 2, 2016
Messages
150
@JoshDW19
Last night the height and the scroll both worked correctly.

Today the line wrapping is back

1546915459590.png
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,085
@JoshDW19
Last night the height and the scroll both worked correctly.

Today the line wrapping is back
The adjustment to vertical scrolling appears to have broken horizontal scrolling. Oops?
 
Top