Rich Text Token - Why does more than one html element trigger html placed outside of container on landing pages?

NestoJosa
Level 3

Rich Text Token - Why does more than one html element trigger html placed outside of container on landing pages?

Hello again Marketo Nation,

 

We have found some strange behavior with Rich Text Tokens, that we would like to get a better understanding of, and that might be of interest to you too! 😀


More specifically, we found that including more than one html element, in the rich text token's value, triggers the output of html placed outside of its container, on a landing page.

Scenario #1

 

The landing page markup:

 

<div 
  id="mktoHook-Hero__headings"
  class="mktoText Hero__headings ..."
  mktoName="Hero__headings">
    <p class="...">{{my.CON TokenName}}</p>
    <h1 class="...">{{...}}</h1>
</div>

 

The rich text token:

 

<p>foo</p>

 

The output on landing page (note the exclusion of any additional p-tag around 'foo'):

 

<div 
  id="mktoHook-Hero__headings"
  class="mktoText Hero__headings ...">
    <p class="Hero__preHeading">foo</p>
</div>

 

So far so good, nothing strange in scenario #1.

But if we add another paragraph to the rich text token, strange things happen...

Scenario #2

 

The rich text token:

 

<p>foo</p>
<p>bar</p>

 

The output on landing page (note the inclusion of p-tags and the placement of the tokens-value outside of container):

 

<div 
  id="mktoHook-Hero__headings"
  class="mktoText Hero__headings ...">
    <p class="Hero__preHeading"></p>
    <p>foo</p>
    <p>bar</p>
    <p></p>
</div>

 

 

The mystery

 

Adding more than one html-tag (in the examples, it's another p-tag) triggers:

- The inclusion of html tags

- The tokens value is placed outside of the container

- A third trailing p-tag (the last p-tag in the above example)

So, why does more than one html element trigger html placed outside of container on landing pages?

I will post a similar question to marketo-support, and I will make sure to update this nation-post when they have replied, for future Googlers.

 

This question is specifically related to landing pages. But we did find a similar issue on the emails:
https://nation.marketo.com/t5/Product-Discussions/Rich-Text-Token-Why-does-more-than-one-html-elemen...

Note:

- The root block elements settings are set to none, for 'Email / Snippet Editor' and 'Landing Page Editor'.

 

Any help/clarification would be much appreciated!


Best,
ernie