Developers · Gutenberg

Markdown Preview block for WordPress

Live Markdown editor with real-time rendered preview, toolbar shortcuts, and copy buttons.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Live Markdown editor with real-time rendered preview, toolbar shortcuts, and copy buttons.

Inspector panels on this block: Content, Features, Layout. Those titles come from index.js, not from a shared template.

Where to find it

Gutenberg inserter → Developers → search “Markdown Preview” (block name `blockenberg/markdown-preview` in block.json). Style it in the sidebar after insert.

How to use Markdown Preview block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Markdown Preview”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Show Title”, “Default Markdown Content”, “Show Toolbar”.
  4. Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Content — TitleText field in the inspector. block.json default: Markdown Editor. Saved as `title`.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Default Markdown ContentMultiline text field in the inspector. block.json default: # Hello, Markdown! Type your **Markdown** here and see the *live preview* on the right. ## Features - Bold, italic, headings - Code blocks - Lists and links - Blockquotes ```js console.log('Hello world'); ``` > This is a blockquote. [Visit example.com](https://example.com). Saved as `defaultContent`.
Show ToolbarOn/off toggle in the inspector. On by default. Saved as `showToolbar`.
Show Word CountOn/off toggle in the inspector. On by default. Saved as `showWordCount`.
Show Copy ButtonsOn/off toggle in the inspector. On by default. Saved as `showCopyBtn`.
Sync ScrollOn/off toggle in the inspector. On by default. Saved as `syncScroll`.
Editor Height (px)Numeric range control in the inspector. Range 200–800. block.json default: 380. Saved as `editorHeight`.
Max Width (px)Numeric range control in the inspector. Range 500–1400. block.json default: 1100. Saved as `contentMaxWidth`.
Accent ColorColor control in the inspector. block.json default: #0ea5e9. Saved as `accentColor`.
Editor BackgroundColor control in the inspector. block.json default: #1e293b. Saved as `editorBg`.
Editor TextColor control in the inspector. block.json default: #e2e8f0. Saved as `editorColor`.
Preview BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `previewBg`.
Preview TextColor control in the inspector. block.json default: #1f2937. Saved as `previewColor`.
Toolbar BackgroundColor control in the inspector. block.json default: #0f172a. Saved as `toolbarBg`.
Section BackgroundColor control in the inspector. block.json default: #f8fafc. Saved as `sectionBg`.
Title ColorColor control in the inspector. block.json default: #0f172a. Saved as `titleColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Markdown Preview block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Markdown Preview”. It sits under Developers. After insert, open Content and set “Content — Title”, “Show Title”, “Default Markdown Content”, “Show Toolbar”.

What makes Markdown Preview different from other Blockenberg blocks?

Live Markdown editor with real-time rendered preview, toolbar shortcuts, and copy buttons. Inspector labels on this block include “Content — Title”, “Show Title”, “Default Markdown Content”, “Show Toolbar”.

Is the Markdown Preview Gutenberg block free?

Yes. Markdown Preview ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Markdown Preview to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Features, Layout).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Markdown Preview from the Gutenberg inserter.

Get Blockenberg