SOLVED

HTML in snippets are being stripped

Go to solution
Anonymous
Not applicable

HTML in snippets are being stripped

We had a few rich snippets with custom HTML that were working perfectly fine before. But now, when we made changes to the snippets, some HTML does not save. It looks like Marketo is filtering the HTML before saving.

Before:

<a class="some-class" onclick="custom_js_function('facebook')" href="javascript:void(0);"> <em class="social-login-icon facebook"></em> Facebook </a> 

Changes to

<a class="some-class"> Facebook </a>

Is there a way to put onclick on the links inside snippets?

1 ACCEPTED SOLUTION

Accepted Solutions
Mel_Dadoly
Level 4

Re: HTML in snippets are being stripped

Hi,

This is due to the new HTML editor. If you revert to the legacy editor, this will work as before. That can be done under Admin > Treasure Chest by disabling Upgraded TinyMCE.

Cheers,
Mel

View solution in original post

3 REPLIES 3
Mel_Dadoly
Level 4

Re: HTML in snippets are being stripped

Hi,

This is due to the new HTML editor. If you revert to the legacy editor, this will work as before. That can be done under Admin > Treasure Chest by disabling Upgraded TinyMCE.

Cheers,
Mel

Justin_Cooperm2
Level 10

Re: HTML in snippets are being stripped

This is actually resolved in the new editor in the upcoming October release. Only small issue is that I tested it and it still strips href="javascript:void(0);" for some reason. We will look into why. Curious why you even have that though. Does it even do anything since you already have the onclick

Justin_Cooperm2
Level 10

Re: HTML in snippets are being stripped

Ok I looked into it. The reason javascript is still stripped is because we had special logic in place for Email content and Snippets (since they can be used in emails). JavaScript is generally not functional in emails and often times it lowers the trust score in terms of spam filters. I will have our engineers remove this validation so that even JS is allowed but I do warn you not to insert this type of stuff into emails.