The important things first: please use the Visual Editor Plugin or Gutenberg whenever possible never ever use shortcodes in the Visual Editor!
Shortcodes are designed to be used with the Text Editor (HTML) only!
Enlighter provides a full Gutenberg-Editor-Integration which allows you to edit add/edit code to your posts seemless.
- Click on the
plus icon
to insert a new Gutenberg Block - Search for
Enlighter Sourcecode
block - Paste your snippet into the text-area
- Select the language of your snippet (javascript in this example)
- You can edit the snippet directly in the Visual Editor at any time
- Publish your post!
Enlighter allows you to highlight codeblocks as well as inline snippets out-of-the-box. Inline-Code is often used to highlight small pieces of code diretly within a larger textblock.
Since: Enlighter v4.4.0
/ Gutenberg Plugin v1.1.0
- Select the content you want to highlight
- Open the format dropdown and select
Enlighter Inline Code
- Select the language of the text
- Publish your post!