Isn't possible to wrapp html into <p> tag?

I’m trying to wrap my html Rich Field Text into a <p> tag.

It happens that it’s not working. The designer manager creates the content outside de tag.

When I use:

<p>
 {{html}}
</p>

It creates an empty <p> tag with the content inside a div below the <p> tag.
It works just with:

<div>
 {{html}}
</div>

<p> elements are only allowed to contain inline elements. A <div> is a block-level element, just like h1 - h6, blockquote, etc. Your <p> tags will become invalid markup once a block-level element is added as a child. The self closing of the <p> tag is by design and it’s generally not a good idea to leave it up to the user to have the knowledge of inline vs block-level elements since the wysiwyg can embed both into the html.


tim@belch.io

Thanks! HubSpot inserts some elements inside the ones you created inside Design Manager.

But for example, I’m creating a “One line text” and I need it to be a H2, will be a title.

I used “Wrapping HTML” like this:

<h2 class="section-title">{{html}}</h2>

It generates:

<h2 class="section-title">
 <div class="span12 widget-span widget-type-text " style="" data-widget-type="text" data-x="0" data-w="12">
 <div class="cell-wrapper layout-widget-wrapper">
 <span id="hs_cos_wrapper_module_1527878222795231" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_text" style="" data-hs-cos-general-type="widget" data-hs-cos-type="text">Sign up for updates.</span> . 
 </div><!--end layout-widget-wrapper -->
 </div><!--end widget-span -->
</h2>

Is this correct? So many levels no?
Because of these levels, I can’t figure out why my H2 tag doesn’t have width and height.
Here a link to show the problem: Tag H2 nesting problem
It’s a title called “Sign up for updates.”, almost in the footer of the page.

where is {{html}} coming from? Is this a custom module? can you add the attribute no_wrapper=“true”

I’m using direct inside the Design Manager.

Try this:

1. Convert “One line of text” module to custom module

2. Use this HUBL markup for the custom module contents

{% text value="{{module.value}}" no_wrapper="True" export_to_template_context="true" %}

3. Add your new module to your template

4. Add this code to the wrapping html

{{html}}
{% for i in widget_data %}
<h2>{{i.value}}</h2>
{% endfor %}

tim@belch.io