rejetto forum

replace line brake with </br>

Foggy · 7 · 6185

0 Members and 1 Guest are viewing this topic.

Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
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.


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
Look at my question about that problem at:

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.
« Last Edit: March 29, 2008, 05:07:45 PM by bacter »
your computer has no brain - use your own !


Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
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.


Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile

Offline Foggy

  • Tireless poster
  • ****
    • Posts: 806
    • View Profile
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.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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)