Make Community posts code-friendly

Highlighted
Level 10 - Community Moderator

Make Community posts code-friendly

The new Community suffers (as did the old) from a near-inability to paste code.  Many Forms- and Munchkin-related questions beg for code snippets, but even with <PRE> tags these never look right and sometimes look downright awful.  The ability to use a CodePen or jsFiddle embed would also suffice.

5 REPLIES 5
Highlighted
Level 6 - Champion Alumni

Re: Make Community posts code-friendly

Hey Sanford,  I agree, but perhaps this should be posted as an Idea.  Scott K. Wilder would that be the best place for this, so members can vote on it?

Highlighted
Level 10 - Community Moderator

Re: Make Community posts code-friendly

I didn't put it there because I didn't want to get in trouble.

Highlighted
Anonymous
Not applicable

Re: Make Community posts code-friendly

Sanford Whiteman​ - are you trying to paste HTML into a Doc? Tell me more how you want to use

use a CodePen or jsFiddle . Just to add code to a post/doc?

(Don't worry you will not get in trouble)

cc: Elliott Lowe

Highlighted
Level 10 - Community Moderator

Re: Make Community posts code-friendly

I mean that 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):

pastedImage_1.png

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;                     }           } 
Highlighted
Anonymous
Not applicable

Re: Make Community posts code-friendly

Thank you for the clarification!