Blocks

Blocks »Code Block

Just like the Posting Source Code feature works in the classic editor, with the code block you can add formatted code for others to view.

Add the code block from the Block Inserter icon or the slash command /code.
Add the code block from the Block Inserter icon or the slash command /code.
Adding content to the code block will wrap the content in  tags.
Adding content to the code block will wrap the content in tags.

In order to add a code block, click on the Block Inserter icon.

You can also type /code and hit enter in a new paragraph block to add one quickly.

Use the slash command /code to insert a code block.
Use the slash command /code to insert a code block.

Detailed instructions on adding blocks can be found here.

Block Interface

Each block has its own block-specific controls that allow you to manipulate the block right in the editor. The code block only offers the block settings icon in the block toolbar. Optionally, you can transform the code block into a preformatted block.

The code block only offers the block settings icon in the block toolbar.
The code block only offers the block settings icon in the block toolbar.

↑ Table of Contents ↑

Most blocks have specific options in the editor sidebar in addition to the options found in the block toolbar. If you do not see the sidebar, simply click the 'cog' icon next to the Publish button.

The code block only offers Additional CSS Classes in the sidebar.
The code block only offers Additional CSS Classes in the sidebar.

Advanced

The advanced tab lets you add a CSS class to your block, allowing you to write custom CSS and style the block as you see fit.

The advanced section lets you add a CSS class to your block.
The advanced section lets you add a CSS class to your block.

Not quite what you're looking for?

Get Help