Your last mod for putting the spaces back into my description field works 90%, it works on all paragraphs except the first line of the field. Hmmm
After
$rec{'Description'} =~ s/\n/<BR>/g;
add
$rec{'Description'} =~ s/ /& nbsp;& nbsp;/g;
(In case it doesn't show up in the UBB page, that's 2 spaces after the s/ -- Also, take out the space between the & and the nbsp; I had to separate them so they would show up at all.)
What that will do is substitute two non-breaking spaces wherever there are two spaces in your field. If you wanted to indent by five spaces, you could put 5 spaces in the first part and 5 & nbsp; in the second part.
The structure for this is
code:
--------------------------------------------------------------------------------
$rec{'FieldName'} =~ s/[what you want replaced]/[what you want to replace it with/g;
--------------------------------------------------------------------------------
The s part means "substitute" and the g part means "global" -- replace all instances. If you don't use the g, it will only replace the first one it finds.
A bonus for me is that I use two spaces after sentences for better readability and this mod puts those back it too. I like that a lot. I usually indent five spaces so the mod converts those to four which is perfectly fine. Now I just need help figuring out why it doesn't work on the first line.
I was think about the a few possible catch 22's, I am going to experiment and see what the mod will do to non-standard paragraph formatting. Let's say I wanted to do a list or insert a Perl routine.
Here is an example of how it is working. Notice the first paragraph is not being indented.
http://www.makeitsimple.com/...sitenews/index.shtml
------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com
[This message has been edited by NgtCrwlr (edited May 17, 1999).]
Quote:
Keeping the indenting is basically the same as keeping the carriage returns. Again, the spaces are there, but html doesn't show them. After
$rec{'Description'} =~ s/\n/<BR>/g;
add
$rec{'Description'} =~ s/ /& nbsp;& nbsp;/g;
(In case it doesn't show up in the UBB page, that's 2 spaces after the s/ -- Also, take out the space between the & and the nbsp; I had to separate them so they would show up at all.)
What that will do is substitute two non-breaking spaces wherever there are two spaces in your field. If you wanted to indent by five spaces, you could put 5 spaces in the first part and 5 & nbsp; in the second part.
The structure for this is
code:
--------------------------------------------------------------------------------
$rec{'FieldName'} =~ s/[what you want replaced]/[what you want to replace it with/g;
--------------------------------------------------------------------------------
The s part means "substitute" and the g part means "global" -- replace all instances. If you don't use the g, it will only replace the first one it finds.
A bonus for me is that I use two spaces after sentences for better readability and this mod puts those back it too. I like that a lot. I usually indent five spaces so the mod converts those to four which is perfectly fine. Now I just need help figuring out why it doesn't work on the first line.
I was think about the a few possible catch 22's, I am going to experiment and see what the mod will do to non-standard paragraph formatting. Let's say I wanted to do a list or insert a Perl routine.
Here is an example of how it is working. Notice the first paragraph is not being indented.
http://www.makeitsimple.com/...sitenews/index.shtml
------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com
[This message has been edited by NgtCrwlr (edited May 17, 1999).]