Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Extra br/ tag after each line when entering html code
 
Diederik
Jr. Member
 
Total Posts:  20
Joined:  2007-09-18
Belgium
 

Hi,

is this normal behaviour of Magento,
When I’m creating a product if I enter html in the product description the output will give me an extra <br/> tag after each line.

Example

<div>
  <
table><br/>
<
tr><br/>
<
td>some text</td><br/>
</
tr><br/>
</
table><br/>
</
div><br/>

Seams like I have to put all the html code on one line to prevent this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

That’s because the templating engine, applies the nl2br php function.
You can remove your nw line in the html, or remove the <br> that you add; or change the core behaivor. (I don’t recommend the last option).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Diederik
Jr. Member
 
Total Posts:  20
Joined:  2007-09-18
Belgium
 

so if I understand you right, the only solution is a core hack or put it all on one line

<div><table><tr><td>some text</td></tr></table></div>

Pff maybe I’ll to a core hack and but [html] tags around the code so it leaves html alone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

I think that it’s better that you remove yours <br>.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Diederik
Jr. Member
 
Total Posts:  20
Joined:  2007-09-18
Belgium
 

You mean remove the line breaks.

I did find a solution for that here it’s a little more work when entering my product data but it works like this without going into the core code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

LOL.
Yes, that’s a great solution.
grin

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top