Too many <br> tags on the entry HTML mark up?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
swu
Posts: 2
Joined: Wed Nov 09, 2005 8:19 am

Too many <br> tags on the entry HTML mark up?

Post by swu »

Hi all,

First thing first thanx for the software and let us enjoy the use of blogging.

I just found an annoying issue (not sure if it is a problem) - when my blog entry text is stored as HTML in the mysql table such as :

Code: Select all

<ul>
    <li>Point 1 blah blah</li>
    <li>Point 2 blah blah</li>
    <li>Point 3 blah blah</li>
</ul>
But when it is displayed when browsing the entries in the browser, it seems the HTML entry body is marked up as:

Code: Select all

<ul><br>
    <li>Point 1 blah blah</li><br>
    <li>Point 2 blah blah</li><br>
    <li>Point 3 blah blah</li><br>
</ul><br>
Virtually putting <br> tags every single line/tag. While this doesnt do anything bad in Internet Explorer (i.e. the br doest add any new spaces), on Firefox, it seems that the br tags are basically doubling the spaces between every 2 lines of text (or in the above case, each line bullet point) and making the appearance full of spaces and ugly in Firefox.

I tried to look up the source but doesnt seem like any particular code is adding <br> tags but my wild guess is something to do with Smarty?

So my question is where I can change the code from adding these <br> tags?

Any help is deeply appreciated. Thanx.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Too many <br> tags on the entry HTML mark up?

Post by garvinhicking »

This behaviour is caused by the "Markup: NL2br" plugin, which converts newlines to breaks.

That plugin just uses the PHP function nl2br(), which does not differentiate on the content of the text. That would require a very bloated and hard regexp parser, and would have a huge performance impact.

Thus, either remove the nl2br plugin and type your breaks/paragraphs manually, or remove the newlines in your HTML code parts?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
swu
Posts: 2
Joined: Wed Nov 09, 2005 8:19 am

Post by swu »

Thanx Gavin it is the plugin issue! Damn I should have checked out the plugin first before i jumped straight to codes...
Post Reply