Re: Translating newlines to HTML paragraphs

2002-05-22 Thread John Brooking
--- Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > I've gone through and read all the other posts in > reply to this, and they > all seem to ignore a very simple solution. > > First: strip off the \r\n: > s/\r\n/\n/sg > > Then look for the pattern \n\n (which would indicate > the existence

Re: Translating newlines to HTML paragraphs

2002-05-22 Thread fliptop
drieux wrote: > but if you wanted to 'clean em all' > > $line =~ s/[$eol]+/\n/g > > would find the case of > > \r > \r\n > \n > \r\n\n > > > and replace them all with a single '\n' for all > occurances in the $line that one is going through wouldn't this reg

Re: Translating newlines to HTML paragraphs

2002-05-22 Thread drieux
On Tuesday, May 21, 2002, at 05:52 , Jake wrote: [..] > If the latter method works, that's cool, i havent tested it. I will admit > that as I learn this stuff, I tend to do everything the hard way first, > then trim it down. I have test it on [darwin|solaris|redhat linux 7.2] - I could get ove

Re: Translating newlines to HTML paragraphs

2002-05-22 Thread Matthew Weier O'Phinney
I've gone through and read all the other posts in reply to this, and they all seem to ignore a very simple solution. First: strip off the \r\n: s/\r\n/\n/sg Then look for the pattern \n\n (which would indicate the existence of an empty line. For example: "Some paragraph text\n\nA new paragraph")

Re: Translating newlines to HTML paragraphs

2002-05-21 Thread Jake
> so I guess the question is - presume that it is either or > and rip them all out before proceding anyway IMHO I think one should presume that it is that way...Thats why we go to the trouble to have standards isnt it? so that everyone doesnt have to go around doing custom work for every

Re: Translating newlines to HTML paragraphs

2002-05-21 Thread drieux
On Tuesday, May 21, 2002, at 05:58 , Felix Geerinckx wrote: > on Tue, 21 May 2002 12:35:59 GMT, [EMAIL PROTECTED] (Bob > Showalter) wrote: > >> This is dependent on the browser, and not the client OS. The >> HTML standard would be controlling here, and it's pretty >> vague if you look at the TEX

RE: Translating newlines to HTML paragraphs

2002-05-21 Thread Felix Geerinckx
on Tue, 21 May 2002 12:35:59 GMT, [EMAIL PROTECTED] (Bob Showalter) wrote: > This is dependent on the browser, and not the client OS. The > HTML standard would be controlling here, and it's pretty > vague if you look at the TEXTAREA section. It was somewhat less vague in the 'HTML 3.2 Referenc

RE: Translating newlines to HTML paragraphs

2002-05-21 Thread Bob Showalter
> -Original Message- > From: Jake [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 20, 2002 5:18 PM > To: John Brooking; Beginners CGI > Subject: Re: Translating newlines to HTML paragraphs > > ... My guess though is that textarea newlines will get sent > as cr/

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread drieux
On Monday, May 20, 2002, at 07:36 , John Brooking wrote: > --- drieux <[EMAIL PROTECTED]> wrote: >> use CGI qw/:standard/; >> >> for a specific illustration cf: >> > http://www.wetware.com/drieux/pbl/cgi/basicPagePopper.txt [..] > The code I included in the message was just > my test scrip

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread John Brooking
--- drieux <[EMAIL PROTECTED]> wrote: > > maybe I am missing something here - but isn't > this something you would want to be using say > > use CGI qw/:standard/; > > for a specific illustration cf: > http://www.wetware.com/drieux/pbl/cgi/basicPagePopper.txt Either you're missing somethi

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread John Brooking
--- Jake <[EMAIL PROTECTED]> wrote: > > On my machine (linux) if I dump textarea input to a > ascii text file like so... > > my $ta = $query->param('myTextArea'); > print outFile $ta; > > newlines are saved as cr/lf which corresponds to the > hex characters 0D and 0A. > > ... [snip stuff abou

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread Jake
On my machine (linux) if I dump textarea input to a ascii text file like so... my $ta = $query->param('myTextArea'); print outFile $ta; newlines are saved as cr/lf which corresponds to the hex characters 0D and 0A. If I look at this file with some text editors it will look like ^M . but it's

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread John Brooking
True, but if I am trying to repeatedly translate in both directions, won't this cause the newlines to grow? For example (P tags shown as [p] here): TEXTAREA sends "Para 1.\nPara 2.\nPara 3." I store: "Para 1.\n[p]Para 2.\n[p]Para 3." Translated back for TEXTAREA next time: "Para 1.

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread drieux
On Monday, May 20, 2002, at 10:51 , John Brooking wrote: > > Thanks in advance for any help. > > - John maybe I am missing something here - but isn't this something you would want to be using say use CGI qw/:standard/; for a specific illustration cf: http://www.wetware.com/dr

Re: Translating newlines to HTML paragraphs

2002-05-20 Thread Jake
On Monday 20 May 2002 01:51 pm, John Brooking wrote: > Hello, all, > has worked so far. Everything I've tried has (1) added > the P tag but not removed the newline, and/or (2) also the first case should work, after all, the browser will ignore newline and carriage return characters, so