Code block
- On your story, go to a new line and click the button on the left to expand the menu.
- Click the “{ }” button to insert a new code block.
You can also create a code block by going to a new line and typing ``` (triple backtick).
Inline code
For inline code in a paragraph, type a single backtick ` to begin and end your code. You can also highlight some text and press the backtick key.
Code block
While editing a post, tap “{ }” button to insert a new code block.
Inline code
For inline code in a paragraph, type a single backtick ` to begin and end your code. Or highlight some text and press the backtick key.
Please note that existing code blocks in stories that have already been published on Medium prior to introducing syntax highlighting will not be automatically updated, just in case they’re being used for something other than code.
If you’d like to update an old code block in a published story, you can edit the story, create a new code block, and paste the old block’s contents into it.
Note: Code blocks are not supported in responses.