Re: Rich Text Token - Why does more than one html element trigger html in output?

NestoJosa
Level 3

Rich Text Token - Why does more than one html element trigger html in output?

Hello again Marketo!


 

Here comes yet another marketo-mystery I was hoping someone could help me solve.

 

I have a piece of content in an email that is populated via a rich text token:

 

The email markup:

 

<div class="mktoText" id="..." style="..."> 
  {{my.CON TokenName}} 
</div>

 

 

The rich text tokens value - a single paragraph:

 

<p>foo</p>

 

 

The output in email - without html-tags:

 

<div class="mktoText" id="..." style="...">
  foo
</div>

 

 

The Mystery


Now, when I add another paragraph to the rich text token:

 

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

 

 

The output is different - the html-tags are all of a sudden visible in the output (!?):

 

<div class="mktoText" id="..." style="...">
  <p>foo</p>
  <p>bar</p>
</div>

 

 

So, the mystery is:

 

  Why does more than one html element trigger html in output?

Sub-question:

 

  Why isn't the p-tags outputted in the first case?

 

Any help would be much appreciated! 🙂

 

Best,

ernie

4 REPLIES 4
Dave_Roberts
Level 10

Re: Rich Text Token - Why does more than one html element trigger html in output?

Hey Ernie, good question here - Im not sure I've got a clear answer for you, but it made me think that this might have something to do with the Root Block Elements setting in the Admin panel. You can find it by navigating to Admin > Email > Edit Text Editor Settings. I've included a snapshot below once you click into "Email" from "Admin". Highlighted you'll find the things to click and the root block settings. In this case, they're set to "None" but the out-of-the-box settings are <p> and <div> (respectively). 

You might check these settings and switch them to "none" (for both) if they're not already. I could maybe see this happening with one paragraph but not two b/c of how a script might interpret this root block setting. I think it's a fairly safe thing to change these to "None" - it does not change anything that already exists on your pages, but will prevent the Rich Text Editor from wrapping your content in <p> or <div> elements that you didn't add (which is sometimes a real pain).

 

Admin > Email > Edit Text Editor SettingsAdmin > Email > Edit Text Editor Settings

I'd be curious if this worked for you or made any difference, let me know if you've got any questions on changing the settings in Admin or how it worked out for you.

 

Thanks,
Dave

NestoJosa
Level 3

Re: Rich Text Token - Why does more than one html element trigger html in output?

Hi @Dave_Roberts

 

Thanks for your prompt response!

 

I checked the settings and they were already set to 'None' for both 'Email / Snippet Editor' and 'Landing Page Editor':

Screenshot of Root Block Elements settingsScreenshot of Root Block Elements settings

 

It's also worth mentioning, that the behavior on the landing pages, for when adding more than one html element in the rich text editor, is somewhat different but more disturbing. I'm about to write another post, for the weird landing page behavior, and I will make sure to attach it to this one, for future googlers.

 

Please let me know if you think of anything else!

 

Best,

ernie

Dave_Roberts
Level 10

Re: Rich Text Token - Why does more than one html element trigger html in output?

Bummer. And weird that there's a different behavior you're seeing w/ the LPs.

I'll keep an eye out for the LP post as well, and try and ear-mark some time to dig into this a little more and see if I can recreate the issue on my end. 

NestoJosa
Level 3

Re: Rich Text Token - Why does more than one html element trigger html in output?

Hi @Dave_Roberts and future googlers!

There is a related issue on the landing-pages:

https://nation.marketo.com/t5/Product-Discussions/Rich-Text-Token-Why-does-more-than-one-html-elemen...

Have a great day!

Best,
ernie