It is currently Mon Oct 20, 2014 5:03 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Teletype test
PostPosted: Thu Jan 24, 2013 7:49 pm 
Offline

Joined: Mon Feb 21, 2005 10:59 pm
Posts: 1294
This is normal text.

This is
teletype text
.


Top
 Profile  
 
 Post subject: Re: Teletype test
PostPosted: Thu Jan 24, 2013 9:41 pm 
Offline

Joined: Sat May 08, 2010 5:26 am
Posts: 768
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:
_ 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:
[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.

Top
 Profile  
 
 Post subject: Re: Teletype test
PostPosted: Fri Jan 25, 2013 5:06 pm 
Offline

Joined: Mon Feb 21, 2005 10:59 pm
Posts: 1294
Should work now.


Top
 Profile  
 
 Post subject: Re: Teletype test
PostPosted: Sat Jan 26, 2013 1:52 pm 
Offline

Joined: Sat May 08, 2010 5:26 am
Posts: 768
Victor,

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

Example:
Code:
[tt] initial space and ending space [/tt]

"
initial space and ending space
"
resulting parsed code:
Code:
[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.


Top
 Profile  
 
 Post subject: Re: Teletype test
PostPosted: Mon Jan 28, 2013 4:16 am 
Offline

Joined: Mon Feb 21, 2005 10:59 pm
Posts: 1294
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


Top
 Profile  
 
 Post subject: Re: Teletype test
PostPosted: Mon Jan 28, 2013 5:17 am 
Offline

Joined: Sat May 08, 2010 5:26 am
Posts: 768
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:
" [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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group