I've been thinking of doing this one for a long time. I consider it a bug fix. Right now, if <pre> tag is in a post, the html of the message will be like:
<br /><pre>
<br>unless ($FORM{$entry} =~ /<pre>/i) {
<br> $FORM{$entry} =~ s/\s+/ /g;
<br> $FORM{$entry} =~ s/<BR>\s/<BR>/g;
<br>} </pre>
unless ($FORM{$entry} =~ /<pre>/i) {
$FORM{$entry} =~ s/<BR>\s\s\s+/<BR><BR>/g;
$FORM{$entry} =~ s/<BR>\t/<BR><BR>/g;
$FORM{$entry} =~ s/\s+/ /g;
$FORM{$entry} =~ s/<BR>\s/<BR>/g;
$FORM{$entry} =~ s/\s<BR>/<BR>/g;
$FORM{$entry} =~ s/<BR><BR>/<P>/g;
$FORM{$entry} =~ s/<P><BR>/<P>/g;
unless ($SingleLineBreaks) {
$FORM{$entry} =~ s/<BR>$AutoQuoteChar/<BRR>/g;
$FORM{$entry} =~ s/<BR>>/<BRR>/g;
$FORM{$entry} =~ s/<BR>>/<BRR>/g;
$FORM{$entry} =~ s/<BR>/ /g;
$FORM{$entry} =~ s/<BRR>/<BR>$AutoQuoteChar/g;
}
}
# 2005-12-13 fixed: remove <br> within <pre> & </pre>
if ($FORM{$entry} =~ /<pre>/i) {
$FORM{$entry} =~ s/<P>/\n<P>/g;
$FORM{$entry} =~ s/<BR>/\n<BR>/g;
my @bodytext = split(/\n/,$FORM{$entry});
my ($preopen, $thisbody);
foreach (@bodytext) {
if ($preopen) { $_ =~ s/<BR>/\n/g; }
if ($_ =~ /<pre>/i) { $preopen = 1; }
if ($_ =~ /<\/pre>/i) { $preopen = 0; }
$thisbody .= "$_";
}
$FORM{$entry} = $thisbody;
}Done.
<br /><pre>
unless ($FORM{$entry} =~ /<pre>/i) {
$FORM{$entry} =~ s/\s+/ /g;
$FORM{$entry} =~ s/<BR>\s/<BR>/g;
}</pre>No double line spacing.
Test Me Board Archive is maintained by Administrator
Powered by tee-WebBBS 0.52x 080701 © 2008 Tarty
0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)