Link to home
Start Free TrialLog in
Avatar of techzzz
techzzz

asked on

Convert line breaks from plain text into HTML formatted paragraphs

Hi...

How can I convert line breaks from plain text into HTML formatted paragraphs?

For example, if I have a text area field containing plain text with several paragraphs (or line breaks), how can I enclose each paragraph with <p></p> tags?

Then the resulting HTML formatted text would output to another text area field.

Thanks!
SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Does that make sense?

Or, are you asking to convert the user input from a text, or textarea into HTML?

In which case, you want the javascript to surround the value with the <pre> tag for you.

Which is it?
Can you provide a more complete example?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of techzzz
techzzz

ASKER

Yes, I want to convert user input from a textarea field, and then output the new code to another textarea field.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.