rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: Foggy on March 29, 2008, 05:30:01 AM

Title: replace line brake with </br>
Post by: Foggy on March 29, 2008, 05:30:01 AM
I have a form that sends multiline text which is saved and can be viewed later on. but I am having trouble with the line brakes(enter/return key) because html needs </br> to start a new line.

The text comes through fine in hfs and saves in the file with the line breaks, etc but html wont show it properly and places it all on one line and then wraps it.

I can set the css style to white-space:pre and the line breaks are follow but the text is no longer wrapped.

is there a way in hfs to replace the line breaks with </br>
eg
{.replace|
|</br>|text
that is
multiline.}

returns

text</br>that is</br>multiline.
Title: Re: replace line brake with </br>
Post by: bacter on March 29, 2008, 06:24:21 AM
Look at my question about that problem at:

http://www.rejetto.com/forum/index.php?topic=5353.msg1033879#msg1033879 (http://www.rejetto.com/forum/index.php?topic=5353.msg1033879#msg1033879)

and rejetto's answer with a proposed workround.

... we must wait for next build to use it.
Title: Re: replace line brake with </br>
Post by: Foggy on March 29, 2008, 12:20:40 PM
Thanks Bacter, I must have missed that post. This will fix the problem I am having in my other thread. When I posted the first one I didn't think of this way around it.
Title: Re: replace line brake with </br>
Post by: Unknown8063 on March 31, 2008, 02:24:30 PM
You do realize the tag is

Code: [Select]
<br/>
right?
Title: Re: replace line brake with </br>
Post by: Foggy on April 01, 2008, 06:40:59 AM
You do realize the tag is

Code: [Select]
<br/>
right?

lol, yeah. I must have been tired and got a closing tag confused with an empty tag.
Title: Re: replace line brake with </br>
Post by: rejetto on April 02, 2008, 12:41:10 AM
yes, i confirm it will be available soon
Title: Re: replace line brake with </br>
Post by: Mars on April 02, 2008, 10:50:46 PM
Quote
  procedure convert();
  begin
  if sameText(p, 'ansi') and sameText(par(1), 'utf-8') then result:=ansiToUTF8(par(2))
  else if sameText(p, 'utf-8') and sameText(par(1), 'ansi') then result:=utf8ToAnsi(par(2))
  else if sameText(p, 'html') and sameText(par(1), 'text') then result:=StringReplace(par(2),'<BR>',CRLF,[rfReplaceAll, rfIgnoreCase])   //add by mars
  else if sameText(p, 'text') and sameText(par(1), 'html') then result:=StringReplace(par(2),CRLF,'<BR>',[rfReplaceAll, rfIgnoreCase])   //add by mars  end; // convert

Not include <br />  to CRLF    (just  a beta test)