I have copied some text from a webpage and used it in a form texarea. This text gets saved as data. The text as copied looks like this:
---------------
The Mercure Inn Continental Broome is located 1km from the heart of Broome
and a short 10 minute drive from Cable Beach, set in tropical landscaped
gardens making it the perfect location for relaxation or adventure.
---------------
There are line breaks due to the width of the paragraph on that webpage.
I then recall the data on a webpage within a javascript. But since there are line breaks, the javascript does not work.
I have tried:
$description =~ s/\n/<br>/g; and
$description =~ s/\n//g;
But still no joy.
Is there any way of getting the copied text into one line only? Sort of like cleaning or tidying up the text.
---------------
The Mercure Inn Continental Broome is located 1km from the heart of Broome
and a short 10 minute drive from Cable Beach, set in tropical landscaped
gardens making it the perfect location for relaxation or adventure.
---------------
There are line breaks due to the width of the paragraph on that webpage.
I then recall the data on a webpage within a javascript. But since there are line breaks, the javascript does not work.
I have tried:
$description =~ s/\n/<br>/g; and
$description =~ s/\n//g;
But still no joy.
Is there any way of getting the copied text into one line only? Sort of like cleaning or tidying up the text.