Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

RE: Re: ASCII to HTML

by httptech (Chaplain)
on Apr 05, 2000 at 03:28 UTC ( [id://6902]=note: print w/replies, xml ) Need Help??


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

You just need to be careful on this one how you set up the textarea... if the textarea wraps the text automatically the browser doesn't necessarily insert linebreaks for you.
So your users may type in an entire story with absolutely no linebreaks, and the <pre> tags will force it all on one line. In this case it's best to turn wrapping off in the textarea, so the output will be a faithful reproduction of what the user typed.

Replies are listed 'Best First'.
RE: RE: Re: ASCII to HTML
by turnstep (Parson) on Apr 05, 2000 at 05:09 UTC

    Excellent point. I have a script that uses PRE tags and TEXTAREA input, and I have to manually wrap the long lines using some code that makes a good guess at where to insert a break if the line is too long. Why some people don't hit the 'Enter' key once in a while* is beyond me! Just goes to show you always have to check for all possible cases when dealing with user input.

    I've gotten people who put over 1000 characters on one line. Sheesh!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found