Description box adding paragraph tags to everything #1607

Closed
samhamilton opened this Issue May 28, 2012 · 3 comments

Projects

None yet

2 participants

The default behaviour of description box is to add a paragraph tags to everything including other HTML code.

Text saved in the Description Box:

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a ligula leo. Proin eu arcu at ipsum dapibus ullamcorper. Pellentesque egestas orci nec magna condimentum luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut ac ante et mauris bibendum ultricies non sed massa. Fusce facilisis dui eget lacus scelerisque eget aliquam urna ultricies. Duis et rhoncus quam. Praesent tellus nisi, ultrices sed iaculis quis, euismod interdum ipsum.</p>
<ul>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet</li>
</ul>

Output on the website:

<div itemprop="description" data-hook="description">
          <p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus a ligula leo. Proin eu arcu at ipsum dapibus ullamcorper. Pellentesque egestas orci nec magna condimentum luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut ac ante et mauris bibendum ultricies non sed massa. Fusce facilisis dui eget lacus scelerisque eget aliquam urna ultricies. Duis et rhoncus quam. Praesent tellus nisi, ultrices sed iaculis quis, euismod interdum ipsum.</p>
</p>
<p><ul>
</p>
<p><li>Lorem ipsum dolor sit amet</li>
</p>
<p><li>Lorem ipsum dolor sit amet</li>
</p>
<p><li>Lorem ipsum dolor sit amet</li>
</p>
<p><li>Lorem ipsum dolor sit amet</li>
</p>
<p><li>Lorem ipsum dolor sit amet</li>
</p>
<p></ul></p>
        </div>
Member
radar commented May 31, 2012

This is happening due to how the product_description method is defined in Spree::ProductsHelper. Let me see if I can fix that up for you.

@radar radar added a commit that closed this issue May 31, 2012
@radar radar Wrap product descriptions in paragraph tags only when there's a line
followed by two line breaks.

Fixes #1607
3e1a219
@radar radar closed this in 3e1a219 May 31, 2012
Member
radar commented May 31, 2012

This should be now fixed on 1-1-stable and master. Please try it out and let us know.

Thanks that looks to have done the job

Cheers
Sam

@tvdeyen tvdeyen pushed a commit to magiclabs/spree that referenced this issue Jun 1, 2012
@radar radar Wrap product descriptions in paragraph tags only when there's a line
followed by two line breaks.

Fixes #1607
63c8839
@GeekOnCoffee GeekOnCoffee pushed a commit to GeekOnCoffee/spree that referenced this issue Jun 1, 2012
@radar radar Wrap product descriptions in paragraph tags only when there's a line
followed by two line breaks.

Fixes #1607
091546a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment