Hi all,
I do know that this kind of question has been thrashed about in the Links SQL dev, plug-in and global forum some-time back.. but since it hasn't solved my issue and because Paul seems to be giving a lot of very useful answers in this forum, here goes:
I have a field name <%Content%>. Importing data into my db, it gets filled with lots of plain text - not HTML! This plain text contains invisible line feeds (hex 0B) and displays properly with paragraphs in all my editors.
I have a global name Content_Formatted :
sub {
my $tags = shift;
my $content = $tags->{Content};
$content = GT::CGI::html_escape ($content);
$content =~ s/\n/<BR>\n/g;
return $content;
}
In my template, I display <%Content_Formatted%> instead of <%Content%>. Now I should get all my plain texts displaying properly, ie line feeds converted to <BR>. That's what people have been saying. But no. Yet the global works because (?) if I insert a new line online modifying manually a record, the new line does display...
So something I've done is wrong or not working! I'd really appreciate some well-explained-for-layman-type-wisdom !
Thanks in advance
Charly
I do know that this kind of question has been thrashed about in the Links SQL dev, plug-in and global forum some-time back.. but since it hasn't solved my issue and because Paul seems to be giving a lot of very useful answers in this forum, here goes:
I have a field name <%Content%>. Importing data into my db, it gets filled with lots of plain text - not HTML! This plain text contains invisible line feeds (hex 0B) and displays properly with paragraphs in all my editors.
I have a global name Content_Formatted :
sub {
my $tags = shift;
my $content = $tags->{Content};
$content = GT::CGI::html_escape ($content);
$content =~ s/\n/<BR>\n/g;
return $content;
}
In my template, I display <%Content_Formatted%> instead of <%Content%>. Now I should get all my plain texts displaying properly, ie line feeds converted to <BR>. That's what people have been saying. But no. Yet the global works because (?) if I insert a new line online modifying manually a record, the new line does display...
So something I've done is wrong or not working! I'd really appreciate some well-explained-for-layman-type-wisdom !
Thanks in advance
Charly