[Resolved] Gutenberg + Sections – Issue with HTML in "text" tab

Home Forums Support [Resolved] Gutenberg + Sections – Issue with HTML in "text" tab

Home Forums Support Gutenberg + Sections – Issue with HTML in "text" tab

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #798310
    threepoint

    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

    #798880
    Tom
    Lead Developer
    Lead Developer

    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!

    #799044
    threepoint

    Thanks Tom! Snail mail sent. 🙂

    #799341
    fa

    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!

    #799636
    Tom
    Lead Developer
    Lead Developer

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

    #799653
    fa

    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?

    #799657
    Tom
    Lead Developer
    Lead Developer

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

    #805981
    fa

    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.

    #806257
    Tom
    Lead Developer
    Lead 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).

    #806400
    fa

    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?

    #806691
    Tom
    Lead Developer
    Lead 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.

    #807099
    fa

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

    #807453
    Tom
    Lead Developer
    Lead 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”?

    #807499
    fa

    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,

    #807525
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.