Page 1 of 1

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

Posted: Wed Nov 09, 2005 8:40 am
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.

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

Posted: Wed Nov 09, 2005 10:58 am
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

Posted: Wed Nov 09, 2005 1:16 pm
by swu
Thanx Gavin it is the plugin issue! Damn I should have checked out the plugin first before i jumped straight to codes...