| | |
|
|
|
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
|
|
Archived message: Double spaces in memo fields (Macromedia Dreamweaver)