Paragraph tags in content field with Divi; Editor lint error with Shortcode tag

Hi,

after the latest update I’m facing some issues with the plugin.

  1. The “Field content” is stripping any <p> in the text.
  2. The syntax <Shortcode my_shortcode /> is causing an error message in the template editor - Unclosed “div” Tag

Hello, thank you for issue description.

  1. I tried <Field content /> with a post type using Gutenberg, and another post type with classic editor. Both are working correctly on my end - the content is formatted with paragraphs. Could you provide any other detail that might help me catch the issue in action?

  2. I’m not seeing any error message in the editor, using the same code snippet posted in the WP support forum: <Shortcode my-shortcode />. It could be that there is actually an unclosed div tag somewhere else in the template.


By the way, in the Discourse editor, inline code can be wrapped in backticks like `this` to prevent it from getting removed in the post. For larger code blocks, they can be wrapped in ```html (before) and ``` (after the block) on their own lines.

Hi Eliot,

thanks for the reply.

For the <p> issue
I’m using Divi with classical editor. In this case Divi is not used to build the content - its simply from the classical editor. Header tags (h1,h2, …) are not touched.

For the error message issue → see the two images. A simple

<Note><Shortcode my_shortcode /></Note>

produces the error - there are no other tags.

Image3

Image2

Just checked - the <Shortcode /> issue is only, when the tag is wrapped into a <div> or any other tag.

I see, it looks like the editor’s “linter”, which checks for valid syntax, needs to know that the Shortcode tag can be self-closing. Probably it will not show the warning if it’s like this:

<Shortcode my_shortcode></Shortcode>

For the paragraph tags in content field, it seems to be a compatibility issue with Divi. Will see if I can track down the cause.

Concerning the shortcode → you are right - it works plain.

For the editor issue - I just want to make clear - I’m NOT using the DIVI builder for the relevant content - just the classic editor in visual mode.

And it worked in 2.4.4 - so some change between the version most likely cause the issue.

Hm, I’m not seeing any issue with the classic editor in visual mode.

Does Divi (or another plugin you might have installed) have a setting that controls post content formatting?

Not that I’m aware of - and I can roll back to 2.4.4 and all is fine again.

Could you try deactivating Divi to see if the issue still happens? I don’t have a copy of Divi at hand, and it seems to be the only difference compared to my test site, where paragraph tags in post content are working.

OK, it seems to be an DIVI issue.

Tried the suggested and the issue was gone. Same result as with 2.4.4 :slight_smile:

1 Like

Ah, good to know that it’s specific to Divi - thanks for confirming.

I found a fairly new version of Divi Builder on GitHub, so I’ll use that to figure out how we can improve compatibility. The issue seems to be related to the_content filter, which filters the post content with a series of formatting functions, including wpautop that adds paragraph tags. Somehow, when Divi is active, that’s not getting applied.