Click to See Complete Forum and Search --> : no line break in custom BBC code, help please


bustya
05-04-2007, 05:55 AM
I have a YaBB forum which is written in perl. I added a custom BBC code but I'm running into a problem with automatically added <br />s. I’m wondering if there’s special syntax I can use to stop line breaks for this particular BBC tag.


Here’s my custom tag:



Which outputs this:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><input type="hidden" name="encrypted" value="$1"></form>

Here’s the code I used to switch the BBC for HTML (which works fine):

$message =~ s~\[form\s*\](.+?)\s*\[/form\]~<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><input type="hidden" name="encrypted" value="$1"></form>~isg;


The only problem here is the value="$1" part.

$1 = a very long encrypted string which won’t work with the <br />s in it. I pasted the string in the message field without breaks but it still inserts them. I also tried wrapping the form tags with <nobr></nobr> but this doesn’t help. Any ideas?

I read something about -n but I have no idea how to implement it.

bustya
05-04-2007, 07:36 AM
I'm looking for the opposite of newline

Scriptage
05-07-2007, 09:08 AM
Try:
$message =~ s~\[form\s*\](.+?)\s*\[/form\]~<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><input type="hidden" name="encrypted" value="$1"></form>~isg;
$message = ~tr/\n//;


Regards

Carl