SOLVED

Re: Remove Unwanted <p>

Go to solution
Anonymous
Not applicable

Remove Unwanted <p>

Is there away to stop the Email editor from adding <p> around everything? I could CSS to turn it off but is there another way?

1 ACCEPTED SOLUTION

Accepted Solutions
Edward_Unthank_
Level 10

Re: Remove Unwanted <p>

Wrap them in empty div tags! When you're in the WYSIWYG, you can edit the HTML, and there when Marketo would normally throw in paragraph tags, you can instead wrap the content in <div> tags. Marketo considers these acceptable and therefore won't swap them out with <p> tags, and in emails your <div> tags (probably) don't have any actual styling to them, so it doesn't affect formatting in email clients.

The WYSIWYG replicates the HTML wrapping of the line you're currently on when you go to a new line. So if you edit the WYSIWYG HTML to be <div>Placeholder paragraph here.</div> and then swap to the non-HTML editor, you'll be editing the text wrapped in that div. When you hit Enter at the end of that line, it'll create a new line wrapped in the same HTML—you'll be creating more <div></div> lines.

You should be careful about using this if either you or your team doesn't understand HTML. Changing the way the WYSIWYG functions like this will quickly change the acronym's meaning from "What you see is what you get" to "What you see ISN'T what you get."

Cheers,
Edward Unthank | Founder, Etumos

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Re: Remove Unwanted <p>

Michael Ramos​ FYI. Moved to Products and Support

FYI. Nice robo avatar

Justin_Norris1
Level 10 - Champion Alumni

Re: Remove Unwanted <p>

Michael Ramos​ my experience has been that if you use the WYSIWYG, tags will be inserted. If you edit the HTML only you can control it.

Edward_Unthank_
Level 10

Re: Remove Unwanted <p>

Wrap them in empty div tags! When you're in the WYSIWYG, you can edit the HTML, and there when Marketo would normally throw in paragraph tags, you can instead wrap the content in <div> tags. Marketo considers these acceptable and therefore won't swap them out with <p> tags, and in emails your <div> tags (probably) don't have any actual styling to them, so it doesn't affect formatting in email clients.

The WYSIWYG replicates the HTML wrapping of the line you're currently on when you go to a new line. So if you edit the WYSIWYG HTML to be <div>Placeholder paragraph here.</div> and then swap to the non-HTML editor, you'll be editing the text wrapped in that div. When you hit Enter at the end of that line, it'll create a new line wrapped in the same HTML—you'll be creating more <div></div> lines.

You should be careful about using this if either you or your team doesn't understand HTML. Changing the way the WYSIWYG functions like this will quickly change the acronym's meaning from "What you see is what you get" to "What you see ISN'T what you get."

Cheers,
Edward Unthank | Founder, Etumos

Anonymous
Not applicable

Re: Remove Unwanted <p>

I keep finding that Marketo no matter what I do wraps text in a <p>. I will give the <div> a try. Thanks

Joe_Reitz
Level 10 - Champion Alumni

Re: Remove Unwanted <p>

This is aggravating... But I'd like to echo what Edward Unthank​ said. The empty DIV tags work a treat.

As an aside, I can't imagine any user that leverages custom templates would ever appreciate superflous lines of HTML added to their emails... Most of my team doesn't understand HTML, so this move puts them out of their depth by default. Again... Aggravating.

If it doesn't look cool, you're probably doing it wrong.
Justin_Cooperm2
Level 10

Re: Remove Unwanted <p>

This isn't true anymore...this thread is very old.

You now have complete control of what the "root block element" is for the text editor in your subscription. Please see this thread: Rich text editor adding paragraph tags

If you don't want <p> to be added when you're editing text, you can change it in Admin. That said, we don't recommend you change it. For the most part, all text editors will add block elements around text so that rich formatting options can be offered. If you don't have a block element, some formatting isn't possible.

Joe_Reitz
Level 10 - Champion Alumni

Re: Remove Unwanted <p>

Well... I just started getting random <p> tags, so...

Helpful link, though. I'll give those ideas a try.

If it doesn't look cool, you're probably doing it wrong.