1 Reply Latest reply on Aug 14, 2013 9:57 AM by 33699

    Additional code mark-up when editing email content

      When I go to edit a email and click on one of the content areas, I use the "Edit HTML Source" instead of just typing in the editor. If I comment out code or not put images in <p> tags it will automatically add the tags in after I hit UPDATE.

      Is their a way I can turn that feature off so it doesn't add additional unwanted code?

      Example if I put:

      <p>text text text</p>
      <img src="link to image" align="right" />
      <p>text text text</p>

      It will put the image tag in a <p> tag automatically when I hit Save. Same for when I comment out <!-- --> some code, it'll break it after the <!-- tag and put the text after the comment into a seperate <p> tag.
        • Re: Additional code mark-up when editing email content
          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 Unthank
          SEO/Web Specialist
          Yesler