Line breaks in text enclosed in code tags.....
#1
If I enclose a piece of text in code tags I expect the following:
1) The rendering on the client should use a mono-spaced font (like Courier new)
2) Each line should be displayed as-is with no extra line-feeds or indents added

On this forum I have discovered when I posted in a recent thread and added the response to a few commands in a code tagged section the displayed text was broken at some white space into twice as many lines as was intended!

By expanding the FireFox window horizontal size I could make the data appear as it should on a single line, but this will not work if the lines are long enough!

In such a case other forums I visit will add a scroll-bar to the bottom of the code frame so that one can see the part of the lines not available inside the window.
This is how it should be because some languages (I believe python is one example) are very sensitive to indentations and the code will execute outright erroneous if these are wrong.
So someone cutting and pasting from a code window will probably get the wrong code and the code itself becomes very difficult to read with the random extra line feeds too.

Could this be corrected on this forum to the standard way of operation, please?
Bo Berglund
Sweden
Reply
#2
you shouldn't put code on the forum in the first place (>10 or 15 lines)
we prefer you use pastebin.com
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Code was just an example, in my case I wanted to show the output of a command line command executed on the Pi.
As it turns out unless one sizes up FireFox to almost full screen the lines are word-wrapped and then make no sense...

My take is:
If you offer the code tags then make them work as on other forums (scrollbars if lines are too long).
Bo Berglund
Sweden
Reply
#4
We currently don't use anything except the standard code tagging MyBB does.
I have been looking at other code tagging options, possibly with some highlighting as well, but haven't had the time yet.

Thanks for the suggestion, I'll take it into advice.
Hobbies: Servers, Kodi, TF2 and Torn (online RPG game)
Reply
#5
I know that the current CSS has some issue with code blocks, but I haven't found a workaround for it. As soon as I give the forum a fixed width everything is as it should be, but with the dynamic width the horizontal scrollbar is somehow broken.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Line breaks in text enclosed in code tags.....00