- This topic has 20 replies, 3 voices, and was last updated 4 years, 3 months ago by Tom.
January 31, 2019 at 9:43 pm #798310threepoint
I’m currently working on a new web build and for this we’re using WP 5.0.3. While using Sections I add a section to a page. I select the “Text” tab opposed to Visual as I want to add HTML. The minute I click Apply and reopen the section to edit, my HTML is minified. See screenshots:
Has anyone come across this before?
KalpeshFebruary 1, 2019 at 9:30 am #798880TomLead DeveloperLead Developer
Yes – this is a bug currently.
Feel free to shoot us an email and we’ll send you a patched version which should fix it: https://generatepress.com/contact
Be sure to mention this topic.
Thanks!February 1, 2019 at 12:43 pm #799044threepoint
Thanks Tom! Snail mail sent. 🙂February 2, 2019 at 1:04 am #799341fa
I have the same problem. I also sent you an email.
Is there a way i can place html code and that it remains just as I write it? I mean, it is not just a matter of the code being minimized, it’s that it places p elements in every line break.
Thanks!February 2, 2019 at 8:10 am #799636TomLead DeveloperLead Developer
I don’t think there’s any way around that now with WP 5.0, unfortunately.February 2, 2019 at 8:22 am #799653fa
Does that mean that I am condemned to save external copy of my html coding since I will lose it each time I come back to edit a section?February 2, 2019 at 8:27 am #799657TomLead DeveloperLead Developer
Not too sure what you mean? It just means the “Text” tab will include the HTML of your content.February 9, 2019 at 8:46 am #805981fa
Sorry I didn’t explain it well I mean that sometimes in the final code some undesired <p> and </p> tags are inserted automatically.February 9, 2019 at 4:17 pm #806257TomLead DeveloperLead Developer
Ah yes, unfortunately, that’s just how WordPress handles the text tab in WP 5.0. All HTML is shown, whereas before they hid the
<p>elements for some reason (even though they were there).February 10, 2019 at 12:30 am #806400fa
The question is that, for example, I insert this code using GeneratePress Sections module, and I place it exactly like that, no line breaks, no p tags:
But then, when published, the page contains p tags just before
<div class="pieIframe">as you can see here:
If instead of using GeneratePress Sections module I just use a WP HTML block the problem doesn’t exist, so I guess that the Text editing in your Sections module is not handling the content as HTML as it should?February 10, 2019 at 8:14 am #806691TomLead DeveloperLead Developer
WordPress itself adds paragraph tags to content added to the old editor – it’s a somewhat annoying issue that’s always happened.
It’s one of the reasons I’m excited for Gutenberg – no more weirdly inserted
<p>tags.February 11, 2019 at 1:01 am #807099fa
So I’m saying it works ok with WP HTML block but the p tags appear when using GeneratePress Sections module in Text mode.February 11, 2019 at 8:24 am #807453TomLead DeveloperLead Developer
One of the reasons I’m excited for Gutenberg – no more weird
<p>tags. Seems strange that’s happening even with no line breaks. What happens if you switch to “Visual” and then back to “Text”?February 11, 2019 at 9:05 am #807499fa
I’m not switching. In fact, the code I get when I edit in text mode your Sections module is the original. But when I publish the page the p tags are there (see my previous screenshots).
I could give you access to the website if you need.
Thanks,February 11, 2019 at 9:37 am #807525TomLead DeveloperLead Developer
But when happens when you do switch? Are any line breaks added to the Text area?
<p>tags is something WordPress does when you save the page, so it’s actually independent of the Sections editor.
I’ll do some digging in case there’s something we can do about it.
- You must be logged in to reply to this topic.