Teletype test

Talk about anything related to the UBCD, PC troubleshooting etc.

Moderators: Icecube, StopSpazzing

Post Reply
Message
Author
Victor Chew
Posts: 1368
Joined: Mon Feb 21, 2005 10:59 pm
Contact:

Teletype test

#1 Post by Victor Chew » Thu Jan 24, 2013 7:49 pm

This is normal text.

This is
teletype text
.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Teletype test

#2 Post by ady » Thu Jan 24, 2013 9:41 pm

I am re-testing this "tt" code because I previously wanted to use it but the "post preview" didn't show the desired result. See the following:

TEST1:
This is
teletype text
. <<-- OK

TEST2 (read "EDIT2" below):
This is
/teletype/text
. <<-- When using "/" inside the "tt" code, it doesn't work as expected :(. This is a problem when trying to use this "tt" BBcode on a *nix-like path. I am searching for some "non-printable" character or some other method so to solve it, still without success. Ideas?


EDIT_UPDATE:
I keep trying alternatives suggested in many other sites, without luck :( :

Code: Select all

_ amper, as like "&#2f;" (equal to "/") or similar
_ [nobbc] or [noparse]
_ [size=100]/[/size]
_ [var]
The "var" BBcode is similar to "tt"+"code", as it is an "inline code" (is like the "code" BBcode but in the same line where the rest of the text is inserted).

I would appreciate any idea how to achieve the desired effect (currently failing, as the above "TEST2" shows).

TIA,
Ady.


EDIT2 (after Victor's next post):
For the record, the original "TEST2" above is

Code: Select all

[tt]/teletype/text[/tt]
and it was not being displayed as expected. After the correction of the parsing code, the same code is indeed displayed correctly. The intention of this paragraph is to clarify "TEST2", where I said it was not being displayed as expected, but now it is.

Victor, thank you.
Last edited by ady on Sat Jan 26, 2013 2:11 am, edited 1 time in total.

Victor Chew
Posts: 1368
Joined: Mon Feb 21, 2005 10:59 pm
Contact:

Re: Teletype test

#3 Post by Victor Chew » Fri Jan 25, 2013 5:06 pm

Should work now.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Teletype test

#4 Post by ady » Sat Jan 26, 2013 1:52 pm

Victor,

If I use space characters inside the "tt" BBcode, the initial and/or ending space characters are "eaten" when parsed.

Example:

Code: Select all

[tt] initial space and ending space [/tt]
"
initial space and ending space
"
resulting parsed code:

Code: Select all

[tt]initial space and ending space[/tt]
(no initial nor ending space characters).

This behavior is normal with most (but not all) BBcodes.


I guess that something equivalent to a "var" BBcode ("inline code", as oppose to "code box") is what I am requesting.

Is the addition of this "inline code" BBcode possible (so any character, including spaces, is parsed "as-is")?

TIA,
Ady.

Victor Chew
Posts: 1368
Joined: Mon Feb 21, 2005 10:59 pm
Contact:

Re: Teletype test

#5 Post by Victor Chew » Mon Jan 28, 2013 4:16 am

Seems like there are two conflicting possibilities:

1) Using {TEXT}, which strips leading and trailing spaces but supports forward slashes
2) Using {SIMPLETEXT} or {INTTEXT}, which does not support forward slashes

So I created another tag called [pre], which lets you embed spaces.

So you need to do [_pre_] <spaces> [_/pre_][_tt_]/path/name[_/tt_] [_pre_] <spaces [_/pre_].

eg.
    
/path/to/file
    
blah blah blah

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Teletype test

#6 Post by ady » Mon Jan 28, 2013 5:17 am

Victor,

What I was looking for was some "inline code". As "code" just displays whatever is written inside its "box", "as-is" without changing / interpreting / parsing anything, I was looking for the same effect, but "inline", not in a "box".

If the only purpose of this "pre" code is to add initial and ending spaces, and "tt" (or any additional BBcode) is still required for the rest of the text, then IMHO there is no real need for "pre", as I could still write the spaces outside "tt" as usual, as in:

"
teletype code with initial and ending space outside its code
"

Code: Select all

" [tt]teletype code with initial and ending space outside its code[/tt] "
The displayed result is similar to the one originally intended, but the spaces are written outside the BBcode.

To be clear, I initially thought "tt" would be enough, but "tt" is not the same as "inline code"; and since the content between "tt" codes was/is still being parsed in one way or another, then I looked for an "inline code" (seen as "var" BBcode in some forums).

Now, if "pre" can really act as "inline code" (no parsing and without the need for "tt"), then "pre" could be useful in some posts. Otherwise, I seem to miss the point of the "pre" code.

Sometimes there is a need for an "inline code" because a "code" box interrupts the normal reading flow, making it more difficult to understand for the reader, and even "ugly".

Since getting an "inline code" available in the forum seems to be more time-consuming than what I expected, I'll probably keep using the well-known good ol' "code" box, just in case, to be sure that the code I want to display is 100% clear and that can be selected and copied exactly as intended. In some cases, the potential reader might need to re-read the post as a whole, but by using "code" I'll be (more) confident that the code itself is displayed (and potentially used) as intended.

I apologize for wasting your time.

Thank you,
Ady.

Post Reply