Double spaces in memo fields

message from Wally Kolcz on 22 Jul 2004
I have a web site that allows people to tell stories. If they choose to
create a new paragraph by hitting enter twice, it won't store in the
database with the double space. When displaying, it all bunches together
into one long paragraph. How do you have it separate into the double spaces
to create a new paragraph?
 
Michael Fesser replied to Wally Kolcz on 23 Jul 2004
.oO(Wally Kolcz)

That's because a sequence of whitespace (blanks, newlines, ...)
collapses when rendered as HTML by default.

The best is to replace the double linebreaks with </p><p> after fetching
the text from the database and put the entire thing inside a paragraph.

A text stored as

paragraph1\n\nparagraph2

in the db would become

paragraph1</p><p>paragraph2

after fetching it and

<p>paragraph1</p><p>paragraph2</p>

when displayed.

HTH
Micha
 
Julian Roberts replied to Wally Kolcz on 23 Jul 2004
I've a 'preserve whitespace' format extension

http://www.charon.co.uk/content.aspx?CategoryID=11
 

Archived message: Double spaces in memo fields (Macromedia Dreamweaver)