JavaScript for WordPress Forums Gutenberg Development Image tag wrapped with

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #125199
    davor.jambor
    Participant

    Hi guys.

    I have created several custom image blocks inside gutenberg, but sometimes it happens that I got meesage “This block contains unexpected or invalid content”. When I try to click on resolve I can see editor is wrapping image with <figure> tag.
    Has anyone seen the same thing? Or found a reason why this is happening and how to fix it?

    Sometimes it happens to my blocks, and sometimes my blocks work fine and I can’t figure out a reason. Tnx

    #125487
    Zac Gordon
    Keymaster

    My starting point would be comparing your markup to the markup in the image examples from the course. It may be that something extra is added or missing. If you would like to share the plugin code would be happy to take a look 🙂

    #126718
    Claybeast
    Participant

    I had this same exact problem. I had a custom plugin that was used for creating custom pagination on posts using a regex pattern and returning the markup through wpautop function in wordpress core formatting.php. Wrapping the plugin to only filter content on the client side, not editors side, fixed it.

    If you can’t figure out your issue I would resort to turning your plugins off one by one and see if that fixes it.

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