Gossamer Forum
Home : General : Perl Programming :

Request of Alex/UBB

Quote Reply
Request of Alex/UBB
Maybe I am dolt, but since this is the CGI/Perl forum, and we do alot of coding examples, is there any way to allow a <pre> tag in so that our code examples looks spiffy? Just wondering if its possible, or I missed it.


------------------
Fred Hirsch
Web Consultant & Programmer
Quote Reply
Re: Request of Alex/UBB In reply to
Just testing the new ubb tag..

Code:
sub blah {
$foo = shift;
print "Testing..";
}

Just testing..
Quote Reply
Re: Request of Alex/UBB In reply to
Ok, just place the
Code:
and
tags around the text and it will blockquote it and put <pre> tags to preserve formatting. I've emailed Ted to see if he'll put this in (mainly so I don't have to remember to update it every time). Smile

Cheers,

Alex
Quote Reply
Re: Request of Alex/UBB In reply to
I did pass it on to Ted (purely selfish as I didn't want to have to keep adding it in) Wink, but here it is. I added:

$ThePost =~ s,(\[code\]\s*)(.+?)(\s*\[/code\]),<BLOCKQUOTE><font size="1" face="$FontFace">code:<\/font><HR><pre>$2</pre><HR><\/BLOCKQUOTE>,isg;

to ubb_library.pl just before the return $post call in sub UBBCode. I also threw in a quick example in ubbcode.html.

Oops, but after editing this I realized I needed to add:

$EditThis =~ s,(<BLOCKQUOTE><font size="1" face=".+?">code:</font><HR><pre> )(.+?)(</pre><HR></BLOCKQUOTE> ),\[CODE\]$2\[/CODE\],isg;

in EditUBBConvert as well.

Hope this helps,

Alex

[This message has been edited by Alex (edited January 15, 1999).]
Quote Reply
Re: Request of Alex/UBB In reply to
Alex,

How about showing off the quick snippet you used to do this, it's quite useful!

Thanks

------------------
Wes Salmon
www.dabuzz.net
www.pdabuzz.com