2 Replies Latest reply on Sep 11, 2015 7:45 AM by jrlarson

    Using CodePen or jsFiddle to embed code

    skwildermarketo

      Has anyone used CodePen or jsFiddle to embed code into a Jive Doc or Discussion? I am trying to figure out how to embed code into the platform without it getting messed up: )

       

        • Re: Using CodePen or jsFiddle to embed code
          skwildermarketo

          More specifics:

          I want to type a code block into a discussion and have it be formatted with monospace font and (hopefully) highlighted, and also copy-and-paste-able.

           

          Or, alternately, use the embed code from a code sandbox like CodePen or jsFiddle and have that show up.

           

          For example, a CodePen embed usually looks like this (screenshot):

          But if I do that same embed in the Community it comes out like:

                    for (var formPrefix = '#mktoForm_', formLaunchers = document.querySelectorAll('BUTTON[href^="' + formPrefix + '"]'), i = 0, imax = formLaunchers.length; i < imax; i++) {                     formLaunchers[i].onclick = function(e) {                               formId = this.getAttribute('href').slice(formPrefix.length);                               MktoForms2.loadForm("//app-aba.marketo.com", "XXX-XXX-XXX", formId, function(form) {                                         MktoForms2.lightbox(form).show();                                })                               return false;                     }           }