Help with line breaks on product description

[ad_1]

Hello, I have a self hosted wordpress website and I’m trying to understand how line breaks are supposed to work, namely for product descriptions.

I’m using the basic editor and if I hit enter once in the wysiwyg view, then nothing is created in the HTML view. However, if I hit enter twice, a bigger space is created visually (not a problem) and a nbsp; is created in the HTML view.

When I render the page, I see the   is preserved, but of course, a white space is not a line break, so all my text is in one big row.

On the other hand, if I use the HTML view, add some <br> tags and publish/update the product immediately, I do get the line breaks in the page. I wouldn’t mind adding the tags manually, but the problem is if I edit it and for some reason switch over to the WYSIWYG view again, the br tags are gone. The same happens if I wrap my paragraphs with <p> tags. It’s very inconvenient.

What is the correct way to have line breaks in product descriptions?

Some more details: I have elementor and woo commerce plugins. I tried to disable most of my plugins looking for conflicts but nothing changed. All my plugins are up to date.

I looked up online for similar problems and I’m confused with the results I see, ranging from “this should work out of the box” to adding filters and changing functions in the theme php file. I’d like to have (please) a clear vision of what should be happening, and what is the best approach to have the line breaks working in the page and not going away if/when I edit the product.

Thanks

  • This topic was modified 13 hours, 17 minutes ago by alco24.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer