Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

RE: RE: Re: ASCII to HTML

by btrott (Parson)
on Apr 05, 2000 at 02:53 UTC ( [id://6899]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: ASCII to HTML
in thread ASCII to HTML

Oops oops oops. Thanks for catching that--I guess I must not always use that regex. :)

But here's your one-liner:

$str = join "\n<p>\n", grep s/\n/<br>\n/g || 1, split /\n\n/, $str;
(The "|| 1" in there makes it so that even paragraphs that don't contain any carriage returns inside of them, and thus don't match in the substitution, still get included in the final list of paragraphs.)

Replies are listed 'Best First'.
RE: RE: RE: Re: ASCII to HTML
by little_mistress (Monk) on Apr 05, 2000 at 23:11 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://6899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found