Hi, Richard:
I've tried quite a few ways to get around the automatic paragraph filtering, and I haven't found a good solution yet. This is the same with the rich text editor throughout all of Marketo, including landing pages and tokens.
There isn't a button you can press to turn off paragraph filtering, as your short and direct answer.
With that said, you can work around it, but it's probably not worth the interruption in your workflow.
One way you can work around this is to combine the HTML into a text token, so the final result when approved will be the code you desire.The goal is to fool the Marketo rich text editor into thinking that you really just typed a single paragraph.
Let's start with your example text:
<p>text text text</p>
<img src="link to image" align="right" />
<p>text text text</p>
Create two new text tokens (NOT rich text token—text tokens aren't filtered, along with some other
differences between text tokens and rich text tokens here) and put the appropriate HTML tags inside:
{{my.pOpen}} = <p>
{{my.pClose}} = </p>
Your example text above becomes:
<p>text text text{{my.pClose}}
<img src="link to image" align="right" />
{{my.pOpen}}text text text</p>
Now this doesn't end up being clean code when you return to the HTML source in the editor, because Marketo will strip the "unnecessary" line breaks within the paragraph. Those three pretty(-ish) lines get smushed together in one semi-minified line. Not exactly clean, or easy to skim as code.
A more reasonable path could be to just create the wrapping <p> tags yourself and style them out of existence:
-
<p style="margin-top:0; margin-bottom:0">Image reference here.</p> This is an "I give up, Marketo, you can have your paragraph wraps, but I'll style them like they don't exist" method. You can add your styling however you want to get the image to appear.
Or if you REALLY want to interrupt your work flow, you can code the email content into a separate editor, copy and paste it into a text token, and just have the "content" of the email be a reference to that text token.
Not as helpful in your case here, but I did find that in making rich text tokens, if the content seems to be one paragraph (just pure text, no <p> or <div> or anything, and is saved immediately), it won't add the paragraph wrap. That's only in some cases, which I believe involves just hitting "save" in some kind of Schrödinger's-Cat-Paragraph-Wrapping situation.
Hope that helps!
Best,
Edward UnthankSEO/Web Specialist
Yesler