Product description html code doesn't get format

Hey Shopify community.

I would like to add some text to the product description, adding some space as a new paragraph + cursive.

I edited the text, and it looks good in both the HTML code and the description field, but once I check the online shop, there is no formatting added, and the text is added as plain text only.

Can someone help here? Thanks a lot!

HTML code:

Este pantalón de corte unisex y talla única es la prenda estrella de la colección. No importa que tengas 16 o 65 años, el pantalón se ajusta a la perfección a tu cintura y, además de cómodo, diferente y divertido, te da un flow difícil de superar. Lo tenemos en varios colores, así que cuidado si te atreves a comprar uno, porque probablemente querrás más.

 

SUGERENCIA - Ver cuidados especiales de este pantalón en DETALLES.

Image from live view added as well.

This is usually caused by your theme stripping or overriding HTML formatting, not the product description itself.

Check whether your product template outputs {{ product.description }} correctly and isn’t using CSS like white-space or a text filter that removes HTML. You can also inspect the page source to see if the <p>, <br>, or <em> tags are present but being ignored by the theme’s CSS.

Hi @naguirregaviria

Check whether your product description is being rendered with {{ product.description }}. If it’s using {{ product.description | strip_html }} (or a similar filter), all HTML formatting like paragraphs, line breaks, and italics will be removed.

For italics, wrap the text in <em> or <i> tags, and use <p> or <br><br> to create new paragraphs.

If the HTML looks correct in the editor but not on the storefront, your theme’s CSS may be overriding the formatting, or the theme may be sanitizing the output.

Best regards,
Devcoder :laptop:

@naguirregaviria ,
If the formatting looks correct in the editor but not on the live product page the issue is usually not the product description itself its how your theme is rendering it.

  • Make sure you are adding actual HTML tags for example

    <p>Este pantalón...</p>
    
    <p><em>SUGERENCIA – Ver cuidados especiales de este pantalón en DETALLES.</em></p>
    
    

    or use <br><br> for line breaks.

  • Check your themes product template. If the description is being output with something like {{ product.description | strip_html }} or another filter that removes HTML all formatting will be stripped. It should simply be

    {{ product.description }}
    
  • If you are using a page builder or a custom product template it may also be sanitizing or overriding the description styles. Inspect the element in your browser to see if the <p> and <em> tags are present but being reset by CSS.

If you can share your theme name or the main-product.liquid snippet where the description is rendered it will be easier to pinpoint the exact cause.

Your theme, “Vinova Salehup” is not very popular so not many have access to the theme code.

However, the text on your screenshot is not a full description, but a “short description” – probably first 200-300 or so characters of your actual description.

To trim your description safely, theme has to strip HTML codes from it first, therefore loosing all formatting.

There are other blocks which output description with embedded HTML.

For example – see theme demo store here: Eco aware long sleeve blouse – SaleHub - Fashion & Clothing Shopify – there is a “Description” tab below which includes all HTML formatting.

If you see the code similar to one below, do not remove the strip_html filter while keepin truncate!
Otherwise you may have problems with opening HTML tags still present, but closing tags missing. This may break your page.

{{ product.description | strip_html | truncate: 300 }}

you did not include your store URL or theme, so I searched Google for the text on your screenshot and it led me to your store.

Store: colorsofbasquecountry.com
Theme: SM Web Expert (Vinova Salehup)

In the source code, your real description still has its formatting tags (I can see <p>...<i>flow</i>...querras mas.</p>), but the theme prints it into the block <div class="product-single__shortdes"> after running it through strip_html, which deletes every tag.

That block near the price is a short “teaser” description. As @tim_tairli noted, the theme strips the HTML so it can trim it safely. Same text with the tags left in keeps the formatting:

On your store the description shows in only that one stripped spot. Your DETALLES and ENVIOS tabs are custom static blocks, not your product description, so the formatted version is not appearing anywhere else.

The theme’s demo has a full “Description” tab, but yours has been replaced with fixed content, so you will not find your formatting there.

Exact steps to find and fix the line:

  1. Online Store, > Themes. ... > Edit code.

  2. In the file search box at the top left, type product-single__shortdes. That is the block from your page. The description line sits right inside it (if the search returns nothing, search strip_html instead).

  3. You will see something like {{ product.description | strip_html }}, possibly with | truncate: 300 after it.

  4. Change it to {{ product.description }}. Remove the whole filter chain, not just strip_html. If you leave a truncate on raw HTML it can cut a tag in half and break the layout, which is the risk tim flagged.

Where did you add that description? In a text block or directly in product description?

Hi,

I saw your issue with the product-description formatting appearing correctly in the Shopify editor but disappearing on the storefront.

The problem appears to be related to the theme output removing the HTML formatting from the product description.

I can handle this as a small fixed-price Shopify task:

  • Work on a duplicate theme

  • Locate the product-description or short-description code

  • Safely remove or replace the formatting restriction

  • Restore paragraphs, line breaks, bold, and italic formatting

  • Test multiple products

  • Check the result on desktop and mobile

  • Provide a short note showing what was changed

Proposed fixed price: $40
Estimated delivery: the same day after receiving collaborator access.

If the issue is still unresolved, please send me the store URL and the name of the active theme.

Best,
Moaz