Page 1 of 1
Problems with display formatting
Posted: Sun Apr 09, 2006 5:22 pm
by rhibbert
I cannot get my blog entry to display properly. Tables have a vast space before them. I'm guessing that this is a problem with the CSS template (I am using the Blue Streak theme).
What do I need to do to fix this?
Thanks
--
Richard
**UPDATE**
I have tried various themes and they all have the same display problem. Hmmm...
Re: Problems with display formatting
Posted: Mon Apr 10, 2006 9:27 am
by garvinhicking
Hi!
The problem is that you are using the "nl2br" markup plugin. This introduces a "<br />" after every whitespace you type -- including in HTML markup.
To solve this, you either need to disable the nl2br markup globally, or you need to type your HTML in one single row.
OR you can install the entryproperties plugin, and with this you can conditionally disable nl2br for specific entries.
OR you can patch the nl2br plugin so that it recognizes if it's within HTML code, and only applies nl2br functions outside of it. So far, nobody of us has succeeded with such a patch, because it's quite regExp intense.
Regards,
Garvin
Posted: Mon Apr 10, 2006 3:30 pm
by rhibbert
I guess that nl2br is installed by default as all I installed was serendipity 1.0 beta2.
However, thanks for the pointer. I managed to resolve the issue by changing
<blockquote>
<table>
<tr>
<th>Parameter</th>
<th>Meaning</th>
</tr>
<tr>
<td>x</td>
<td>Extract files</td>
</tr>
<tr>
<td>z</td>
<td>Filter archive through gzip</td>
</tr>
<tr>
<td>v</td>
<td>Verbose output</td>
</tr>
<tr>
<td>f</td>
<td>Use archive file</td>
</tr>
</table>
</blockquote>
to a single line
<blockquote><table><tr><th>Parameter</th><th>Meaning</th></tr><tr><td>x</td><td>Extract files</td></tr><tr><td>z</td><td>Filter archive through gzip</td></tr><tr><td>v</td><td>Verbose output</td></tr><tr><td>f</td><td>Use archive file</td></tr></table></blockquote>
It looks like nl2br puts a linefeed before the table for every linefeed within the code for the table.
Thanks again. Out of interest, how would I disable nl2br?
--
Richard
Posted: Mon Apr 10, 2006 4:00 pm
by garvinhicking
Hi!
Yes, nl2br is a default plugin, because most users want to enter text straighly into the box without using HTML.
nl2br inserts \n<br /> linebreaks in between the HTML markup, but most browser render any usual code within <table> markup to appear BEFORE the <table>.
Disabling the plugin would take you to the s9y admin interface, then click on "Configure Plugins", on the right go to the listing of "event" plugins. Then look for the nl2br plugin, tick the box next to it, go below and click on "Delete".
HTH,
Garvin
Posted: Mon Apr 10, 2006 6:14 pm
by rhibbert
Thanks Gavin. Demon support!

what do you do if you want <p> instead of <br>?
Posted: Thu Apr 27, 2006 12:08 pm
by hyperorbiter
it would be useful if i could set this because my paragraph styles aren't working too well : all the paragraphs are rammed together and i wouldn't mind putting an indent in there or space between...thoughts?
Re: what do you do if you want <p> instead of <br&g
Posted: Thu Apr 27, 2006 12:41 pm
by garvinhicking
hyperorbiter: The s9y default CSS sets the "margin" of a "p" element to 0px, to ratify problems with inserting WYSIWYG pasted code.
You can edit your style.css stylesheet and remove this margin on the p element!
Regards,
Garvin
thanks for the suggestion but:
Posted: Fri Apr 28, 2006 2:03 am
by hyperorbiter
thanks garvin, but the issue is that the nl2br plugin converts paragraph endings into line breaks wihtin a paragraph, rather than actual paragraph breaks. i'd like them to be '<' p '>' rather than '<' br '>'
Re: thanks for the suggestion but:
Posted: Fri Apr 28, 2006 10:38 am
by garvinhicking
Hi!
Ah, that won't work. <p> Tags are by definition double-tags. Using "<p>" alone is invalid HTML markup. You would need to wrap each line into a <p>...</p>, which nl2br does not support. So you would need to create your own plugin for this text transformation...
Best regards,
Garvin
ending paragraph tag
Posted: Tue Jul 25, 2006 9:02 pm
by dogshed
Since when is the ending paragraph tag not optional?
SGML allows you to make an ending tag optional and for many years it was in html. Did someone change that? -Jeff
Re: ending paragraph tag
Posted: Wed Jul 26, 2006 12:20 pm
by garvinhicking
Hi!
dogshed wrote:Since when is the ending paragraph tag not optional?
Since XHTML, which Serendipity is strifed for. Optional end tags were removed then, about 5 years ago.
Best regards,
Garvin