Post Reply 
Code section TAB test
12-30-2019, 09:28 AM (This post was last modified: 12-30-2019 09:29 AM by ijabbott.)
Post: #1
Code section TAB test
All intra-line whitespace below the ruler line consists of ASCII TAB characters. Will the tab stops line up?

Code:
         1         2         3         4         5
12345678901234567890123456789012345678901234567890
a    a    a    a    a
ab    ab    ab    ab    ab
abc    abc    abc    abc    abc
abcd    abcd    abcd
abcde    abcde    abcde
abcdef    abcdef    abcdef
abcdefg    abcdefg    abcdefg

Nope.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
12-30-2019, 01:14 PM (This post was last modified: 12-30-2019 01:16 PM by Joe Horn.)
Post: #2
RE: Code section TAB test
Never use tabs for anything on the web. Use explicit spaces instead, like this:

Code:
         1         2         3         4         5
12345678901234567890123456789012345678901234567890
a       a       a       a       a
ab      ab      ab      ab      ab
abc     abc     abc     abc     abc
abcd    abcd    abcd
abcde   abcde   abcde
abcdef  abcdef  abcdef
abcdefg abcdefg abcdefg

This actually is a Good Thing, since tab width is variable and therefore unpredictable in plain-text files, whereas spaces are predictable in code blocks in this forum.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
12-30-2019, 06:28 PM
Post: #3
RE: Code section TAB test
(12-30-2019 01:14 PM)Joe Horn Wrote:  Never use tabs for anything on the web. Use explicit spaces instead, like this:

Code:
         1         2         3         4         5
12345678901234567890123456789012345678901234567890
a       a       a       a       a
ab      ab      ab      ab      ab
abc     abc     abc     abc     abc
abcd    abcd    abcd
abcde   abcde   abcde
abcdef  abcdef  abcdef
abcdefg abcdefg abcdefg

This actually is a Good Thing, since tab width is variable and therefore unpredictable in plain-text files, whereas spaces are predictable in code blocks in this forum.

Hi Joe, I'm aware of that. The issue of tab stops not lining up came up in a recent thread, so I just created this thread to demonstrate the current behaviour.

In theory, it is fixable in the MyBB PHP code (and it would be great if it that also had an option to set the tab width, using something like [code tabwidth=8], for example), although I'm not expecting it to get fixed. The PHP code would just need to work out how many &nbsp; entities to emit for each TAB character, instead of always emitting exactly four &nbsp; entities.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)