Can't remember how to create "new" code block with drop-down language selector in my rich text fields

I must be doing something stupid but I can no longer create a new-format code block in my rich text fields: briefly I was able to create the “new” code blocks (with the full grey background and the drop-down language selector) but now I can only create the “old” code blocks (with the per-line orange background and no language selector): what did I forget?!

There are two ways of doing it:

  1. Use the “/” menu:

image

  1. Use the keyboard shortcut Ctrl+Alt+5

Hope that answers your question :slight_smile:

1 Like

Ah: of course!! I was totally blind to the fact that the code block in the contextual popup is different from the code block in the “/” menu! Thanks so much!!

And the third way, a code block may also be initiated by typing 3 back ticks.

Little tip - If you use a code block at the end of the page, and you can’t figure out how to leave the block, hit “shift + enter” to return back to the normal page.

And there’s a nice ‘diff’ language feature, that allows you to do:

- Bring me Apples
+ Bring me Pears
2 Likes

There used to be a hint for this but I think when they added the syntax highlighting it got undone.

The Diff language is pretty neat but I can’t think of a use case for it. What do you use it for?

I assume you would just paste in the output of the diff executable, and it would render it properly? Cute.

Re: diff, we use it for a few different things, but a common non techy one is change this to that.

- Little Company Inc
+ Growth By Acquisition Corporation