I am using FCKeditor in one of my form, when i copy and paste something
into it using WordPaste, it appends few newlines at the beginning and at
the end.
How can i strip just those \n without effecting the inbetween newlines
and the formatting.
Its a simple form to create a job. FCKeditor has been placed with the
name job[description].
At the create event, it assigns the value to @job.description.
I was trying to strip it before saving like:
@job.description = params[:job][:description].strip, but it isnt solving
the purpose.
In the db, the description field shows a number of blank lines at the
beginning and end.
I am using FCKeditor in one of my form, when i copy and paste something
into it using WordPaste, it appends few newlines at the beginning and at
the end.
How can i strip just those \n without effecting the inbetween newlines
and the formatting.
This is probably best done with a regular expression.
Priya Saini wrote:
> Hi:
>
> I am using FCKeditor in one of my form, when i copy and paste something
> into it using WordPaste, it appends few newlines at the beginning and at
> the end.
> How can i strip just those \n without effecting the inbetween newlines
> and the formatting.
>
This is probably best done with a regular expression.