Gossamer Forum
Home : Products : DBMan : Discussions :

How to Get rid of <br> during modifying.

Quote Reply
How to Get rid of <br> during modifying.
I have replaced the `` with <br> in encode sub.

This will look like something given below:

##### Endcode Sub########

my
(%hash) = @_;
my ($tmp, $col, $output);

foreach $col (@db_cols) {
$tmp = $hash{$col};
$tmp =~
s/^\s+//g; # Trim leading blanks...
$tmp =~
s/\s+$//g; # Trim trailing blanks...
$tmp =~
s/\Q$db_delim\E/~~/og; # Change delimeter to ~~ symbol.
$tmp =~
s/\n/<br>/g; # Change newline to `` symbol.
$tmp =~
s/\r//g; # Remove Windows linefeed character.
$output .= $tmp . $db_delim;
# Build Output.
}
chop $output;
# remove extra delimeter.
$output .=
"\n"; # add linefeed char.
return $output;


******** End of Encode Sub ************

NOW I Can see reasonable line breaks when I view my input. Which I was not seeing before.

But the PROBLEM is now, When I try to MODIFY input it shows <br><br> after every line break.

Is there some way to get rid of <br> during modyifying along with normal viewing with <br>. Both can go togather???

Please Help me!!!

I really need your help.

Zeshan.
Quote Reply
Re: [zeshan] How to Get rid of <br> during modifying. In reply to
I have

$tmp =~ s/\n/``/g; # Change newline to `` symbol.


The modify seems to take care of itself.

And in html.pl

Code:
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash. my (%rec) = @_; # Load any defaults to put in the VALUE field.
# mod to handle line breaks
# from bobsie. (ESM: Note the order)
$rec{'Description'} =~ s,\n\n,<br><br>,g;
$rec{'Description'} =~ s,\n,<br>,g;


($db_auto_generate and print &build_html_record(%rec) and return);


I hope that works

There may be other places in dbman ( What little I know, I know in Links mostly, although they are very simiilar )


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] How to Get rid of <br> during modifying. In reply to
Thanks a lot buddy.

It worked!!!!!!!!
Quote Reply
Re: [zeshan] How to Get rid of <br> during modifying. In reply to
Actually, I think Stealth either posted something similar or suggested the solution in the Links forum or directed me to the bobsie code...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."