Skip Navigation

[Resolved] HTML Tags stripped

This thread is resolved. Here is a description of the problem and solution.

Problem:
The First WYSIWYG occurrence in a Content Template (CT) will strip the "p" tags.

OR

If a post is edited using the DIVI builder but displayed through a Content Template in a Views loop, the "p" tags wrapping the shortcodes are stripped.

Solution:
https://toolset.com/errata/paragraph-tag-is-stripped-in-wysiwyg-loop-items-and-page-builders-generated-content/

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 11 replies, has 4 voices.

Last updated by Christophe Lepretre 6 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#544270
wp-types-view-error-divi.png

Hi

The issue is on the front-end here:
hidden link

I need a view to display the 3 latest posts

The loop item code is:

<h3 class="georgia">[wpv-post-link]</h3>
<p>[wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"] - [wpv-post-date]</p>
<p>[wpv-post-featured-image size="et-pb-post-main-image"]</p>
<p>[wpv-post-excerpt]</p>
<p><a class="lien-bouton fond-orange" href="[wpv-post-url]">Lire la suite</a></p>

Here's the wrong html output for articles 1 and 2, using DIVI builder to edit post content:

<h3 class="georgia"><a href="<em><u>hidden link</u></em>">Article 1</a></h3>

<a href="<em><u>hidden link</u></em>">Non classé</a> – 27 juin 2017

<img src="<em><u>hidden link</u></em>" class="attachment-et-pb-post-main-image size-et-pb-post-main-image wp-post-image" alt="" width="400" height="250">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet rhoncus magna. Aliquam sit amet consequat mauris. Curabitur vel tristique lectus, id ullamcorper ex. Pellentesque a sagittis ligula. Nulla sit amet urna eu quam facilisis consectetur …</p>

<p><a class="lien-bouton fond-orange" href="<em><u>hidden link</u></em>">Lire la suite</a></p>

Here's the rigth html output for Article 3 using the core WordPress editor to edit post content:

<h3 class="georgia"><a href="<em><u>hidden link</u></em>">Article 3</a></h3>

<p><a href="<em><u>hidden link</u></em>">Non classé</a> – 1 juillet 2017</p>

<p><img src="<em><u>hidden link</u></em>" class="attachment-et-pb-post-main-image size-et-pb-post-main-image wp-post-image" alt="" width="400" height="250"></p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sit amet ligula dui. Cras condimentum porttitor quam vel vulputate. Maecenas dictum, mi nec tincidunt viverra, diam libero consequat ipsum, eget facilisis nisl metus eu sem. Nam purus aug …</p>
<p><a class="lien-bouton fond-orange" href="<em><u>hidden link</u></em>">Lire la suite</a></p>

Article 1 and 2 are edited using the DIVI builder. Article 3 using the WordPress core text editor

For some unknown reason the <p> tags around the taxonomy and the featured image are missing in front-end when the DIVI builder is enabled in the post.

Everything is fine when the WordPress core editor is used in Article 3.

it gets wrong when I enable DIVI builder to edit the post content. It gets fine when I disable the DIVI builder and use the core WordPress editor instead.

#544358

Hi, that's strange. I'll be glad to take a look.

First, can you tell me if your Loop code is placed in a Content Template? If so, what are the Output settings? You can find these at the bottom of the Content Template editor screen, and they are either "Auto-insert paragraphs" or "Manual paragraphs".

Next, please temporarily disable Toolset Divi Integration and SVG Support plugins. Is the problem still present?

Then, can you show me how this View was added to the page? If it's in a Layout Visual Cell editor, is the shortcode added inside another tag, or using the "Visual" tab somehow? What is the code in the HTML panel?

Any additional detail you can provide here would be helpful. Thanks!

#544395
Edit Content Template .png
shortcode-wp-types-views.png

Hi Christian

Thanks a lot for your quick response.

-------------------------------------------------

1. First, can you tell me if your Loop code is placed in a Content Template? If so, what are the Output settings? You can find these at the bottom of the Content Template editor screen, and they are either "Auto-insert paragraphs" or "Manual paragraphs".

Please check the screenshot

----------------------------------------------------

2. Next, please temporarily disable Toolset Divi Integration and SVG Support plugins. Is the problem still present?

No effect

----------------------------------------------------

Then, can you show me how this View was added to the page? If it's in a Layout Visual Cell editor, is the shortcode added inside another tag, or using the "Visual" tab somehow? What is the code in the HTML panel?

The view was added through a shortcode inside a text module of DIVI builder.
Check screenshot

----------------------------------------------------

I think I should give you admin access to save time.

Waiting for your permission to do so.

Thanks

#544399

Okay private reply fields are enabled here so you can share login credentials. Thanks.

#544799

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Christian is currently unavailable due today but will be back on Wednesday to check in on this ticket.

Thanks,
Shane

#545237

Hi, in my own testing I've found that this only seems to happen if the paragraph tags are inside a Content Template. If you replace the Content Template shortcodes in your Loop Output editor with the same HTML code from this Content Template, the problem is resolved. I'm reaching out to our 2nd tier support team to see if this is a known issue, or if there is a solution I'm not aware of that will allow you to use Content Templates here without losing markup. Please stand by and I will update you when I have some more information.

#546562

Another potential workaround suggested by the team:
- Add paragraph tags in the Content Template
- Apply automatic paragraph tags in Content Template
- Insert Content Template in Loop using the wpv-autop shortcode wrapper:

[wpv-autop][wpv-post-body view_template="module-blog-accueil"][/wpv-autop]
#547051

Hi Christian

Thanks for getting back to me

After reading your last response, I found a workaround, the only one that works so far:
Remove <p> tags + Double line breaks + Auto-insert paragraphs + featured image url instead of img html tag

<h3 class="georgia">[wpv-post-link]</h3>

[wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"] - [wpv-post-date]

<img src="[wpv-post-featured-image size="et-pb-post-main-image" output="url"]">

[wpv-post-excerpt]

<a class="lien-bouton fond-orange" href="[wpv-post-url]">Lire la suite</a>

It works only when I use the output url for the featured image. If I choose to insert the whole image tag instead:
[wpv-post-featured-image size="et-pb-post-main-image"]
the output fails to wrap it inside <p></p>

-------------------------------------

Below a few comments on your last response (no criticism, just to help sort out the buggy output)

- Add paragraph tags in the Content Template
This is what I did in the beginning, and why I contacted the support in the first place.

- Apply automatic paragraph tags in Content Template
Ok applied. I removed <p></p> tags from the content template and added double line breaks instead + output mode = Auto-insert paragraphs .
But still, the output won't wrap the featured image [wpv-post-featured-image size="et-pb-post-main-image"] inside <p></p>
The other elements are ok, the output wraps them automatically inside <p></p>

- Insert Content Template in Loop using the wpv-autop shortcode wrapper:
I'm probably too new to toolset to understand the full meaning. Please can you send me the whole code I should embed ? And then I will probably be able to infer what this means by looking at the code.

------------------------------------

To finish with, a funny thing I noticed in the code below:

<h3 class="georgia">[wpv-post-link]</h3>
<!--double line break-->
[wpv-post-taxonomy type="category" separator=", " format="link" show="name" order="asc"] - [wpv-post-date]
<!--double line break-->
<img src="[wpv-post-featured-image size="et-pb-post-main-image" output="url"]">
<!--double line break-->
[wpv-post-excerpt]
<!--double line break-->
<a class="lien-bouton fond-orange" href="[wpv-post-url]">Lire la suite</a>

The <!--double line break--> comments create a <br> tag inside the <p></p> in the output !

----------------------------------------------

Thanks for your help, I would really appreciate an example of code for your third solution

#547063

Sure, I pasted the code in the previous comment but here's a complete standard Loop with the Content Template wrapped in [wpv-autop] as described:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>
                [wpv-autop][wpv-post-body view_template="module-blog-accueil"][/wpv-autop]
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]
#560336

Hello, just a quick update here to let you know we haven't forgotten about this issue. I will continue to update you here as I receive more information.

#579379

We have an erratum now, with several workarounds. These will be eventually modified, extended or updated in any way.
https://toolset.com/errata/paragraph-tag-is-stripped-in-wysiwyg-loop-items-and-page-builders-generated-content/

Please keep an eye on the erratum so to stay tuned.

Thank you.

#580745

Hi there

Thanks for your help. I haven't had time to look into it lately as I moved to new projects in between, but I guess there are enough solutions to solve the issue. I'll pick what works best for me.

Thanks

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.