Description Missing New Lines
-
I can’t get a line break in the product description. Please show me how to solve it. Thank !
-
Hi @tomkennh
Thanks for reaching out!
I understand that you’re unable to add a line break in the product description field.
I replicated the scenario on my personal site running on the default Storefront theme, however, I am unable to reproduce the issue on my end.
Back-end:

Front-end:

Could you please provide additional details so I can better assist you?
If a screenshot would be helpful, I’d recommend using https://snipboard.io. You can share the direct link to the image as a response to this topic.
Furthermore, I’d like to understand your site properly. Please share your System Status Report that you can find via
WooCommerce > Status. SelectGet system reportand thenCopy for support. Once you’ve done that, you can paste it into your reply here.If you could also provide the fatal error logs (if any) under
WooCommerce > Status > Logs.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Thanks!

here is the text in the editor

and here is the text displayed on the product page
I think HTML tags stripped.Hello @tomkennh,
I think HTML tags stripped.
I believe you are importing products from Square. If that’s the case, it is expected that all tags will be removed; the description will be converted to plain text.
To resolve this issue, you can add the following snippet using a code-adding plugin such as Code Snippets:
/** * Enable HTML descriptions during Square import * * @param array $data Product data. * @param SquareConnectModelCatalogObject $catalog_object The catalog object from the Square API. * @param WooCommerceSquareSyncProduct_Import $product_import Import class instance. * * @return array */ function my_square_enable_html_description( $data, $catalog_object, $product_import ) { $data['enable_html_description'] = true; return $data; } add_filter( 'woocommerce_square_create_product_data', 'my_square_enable_html_description', 10, 3 );For more context, you can check this part of the documentation.
Hope this helps!
I do your instructions but it still doesn’t work 🙁
Hi @tomkennh
Thanks for trying @babylon1999 solution above.
Can you please try to switch to the default Storefront theme and only WooCommerce, Square and Code Snippets plugins are enabled, try to run a product import using Square and see if this works?
Otherwise, I’d like to understand your site properly. Please share your System Status Report that you can find via
WooCommerce > Status. SelectGet system reportand thenCopy for support. Once you’ve done that, you can paste it into your reply here.If you could also provide the fatal error logs (if any) under
WooCommerce > Status > Logs.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Thanks!
Hi,
We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.
Best.
The topic ‘Description Missing New Lines’ is closed to new replies.