Bulleted lists has <br/> added . Results in double spaced list

When using bullets in the short description of a product, the WYSIWYG editor stores the list correctly in the database (without added <br/>, but when the description is placed in the product view page a <br/> is added to the end of each list item.

I checked the magento forum and many people have experienced this problem. The solution posed there is to remove the nl2br code from the view.phtml file.

I have done this and it works, but my concern is will that cause other problems? Why is the nl2br code there to begin with?

So I replace this code:

Code:

<div class="short-description"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>

with

Code:

<div class="short-description"><?php echo $_helper->productAttribute($_product, $_product->getShortDescription()); ?></div>

in the …/template/catalog/product/view.phtml file.

1 answer

Profile photo of thangnn1510 0.00 $tone June 17, 2011
Public

Hi David!

This is functional of the function you ask:

nl2br — Inserts HTML line breaks before all newlines in a string

This is a Magento default and we haven’t removed it. Thanks for your solution in this case.

#1

Please login or Register to Submit Answer

Written By

Comments