Jump to the post that solved this thread.
Not Solved [General] Code Boxes not showing New Lines/Tabs
#1
Not Solved
Hello, I've done some recent upgrades to my forum. Current MyBB version is 1.8.41. After the upgrades, the Code Boxes are not working correctly. New Lines/Tabs withing the Code Box do not display leaving the text un-tabbed. The new lines/tabs still appear via Quick Edit.

PHP Version is 8.2.35

I have the following plugin installed:
Limit Daily Registration (1.1) by Starpaul 20

I have the following theme installed:
https://community.mybb.com/mods.php?action=view&pid=870  Version 0.5 (dev)

Also this is what my global.css is showing for Code blocks:

.codeblock {
background: #fff;
border: 1px solid #ccc;
padding: 10px;
}

.codeblock .title {
border-bottom: 1px solid #ccc;
font-weight: bold;
padding-bottom: 3px;
margin: 0 0 10px 0;
}

.codeblock code {
overflow: auto;
height: auto;
max-height: 200px;
display: block;
font-family: Monaco, Consolas, Courier, monospace;
font-size: 13px;
}

Here's a link to a thread on my site where you can see the Code Boxes not showing new lines/tabs - https://mariokartwii.com/showthread.php?tid=1563
Reply
#2
Not Solved
In .codeblock code, after "font-size: 13px;" add these two lines:

white-space: pre;
tab-size: 4;

This was mentioned in the 1.8.40 release notes but it's easy to miss.
Reply
#3
Not Solved
(2026-10-22, 05:29 PM)Dave H Wrote: In .codeblock code, after "font-size: 13px;" add these two lines:

white-space: pre;
tab-size: 4;

This was mentioned in the 1.8.40 release notes but it's easy to miss.

I would have missed that too. Just recently started noticing need to make custom edits. Wonder why we don't have something to automate some of these kind of edits. makes it harder for newer users to understand what's going on when all they are trying to do is update. Update should be seemless.

have a similar frustration with theme updates. Working on a plugin to automate this too. May have to adopt something to calculate changes not added from updated version changelogs.
Reply
#4
Not Solved
(2026-10-22, 05:29 PM)Dave H Wrote: In .codeblock code, after "font-size: 13px;" add these two lines:

white-space: pre;
tab-size: 4;

This was mentioned in the 1.8.40 release notes but it's easy to miss.

Works perfectly. Thank you.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)