Site logo

Archived topic

Gutenberg + Sections - Issue with HTML in "text" tab

20 replies · Started by threepoint on January 31, 2019

Viewing posts 1–15 of 21

Hi there
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:

Pre-Apply: https://imagebin.ca/v/4VUFCqqeSReR
Post-Apply: https://imagebin.ca/v/4VUFVGwSI2Br

Has anyone come across this before?

Many thanks
Kalpesh

Hi there,

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!

Thanks Tom! Snail mail sent. :)

Hi,
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!

I don't think there's any way around that now with WP 5.0, unfortunately.

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?

Not too sure what you mean? It just means the "Text" tab will include the HTML of your content.

Hi,

Sorry I didn't explain it well I mean that sometimes in the final code some undesired <p> and </p> tags are inserted automatically.

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).

Hi,

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?

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.

So I'm saying it works ok with WP HTML block but the p tags appear when using GeneratePress Sections module in Text mode.

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"?

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,

But when happens when you do switch? Are any line breaks added to the Text area?

Adding <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.

This archived topic is closed to new replies.