Gossamer Forum
Home : Products : Links 2.0 : Customization :

Converting `` to \n

Quote Reply
Converting `` to \n
I have a field in the categories section entitled 'Address' which is configured as a 4 line text box. When the scripts saves the data it converts the new line character (\n) to ``. However, when I go to view the record in the admin section, instead of converting back to a new line character, it is replaced with a space. I looked at sub split_decode and I see that in there it is making the proper substitution. So, my question is how do I convert the `` back to a new line character when viewing a record on the admin screen?

Quote Reply
Re: Converting `` to \n In reply to
Maybe you can check the following sub:

Code:
sub split_decode {
# --------------------------------------------------------
# Takes one line of the database as input and returns an
# array of all the values. It replaces special mark up that
# join_encode makes such as replacing the '``' symbol with a
# newline and the '~~' symbol with a database delimeter.

my ($input) = shift;
my (@array) = split (/\Q$db_delim\E/o, $input, $#db_cols+1);
foreach (@array) {
s/~~/$db_delim/g; # Retrieve Delimiter..
s/``/\n/g; # Change '' back to newlines..
}
return @array;
}