Add Mermaid Diagram from the inserter on any post type, type the diagram in Mermaid syntax, and use the toolbar’s Preview button to see it drawn. Source returns to the text. Wide and full alignment and an HTML anchor are supported.
The block is static. The diagram source is saved as the plain text of a pre element and nowhere else, so it is versioned by revisions and anything that can write post content can write a diagram:
<!-- wp:lh-mermaid/diagram -->
<pre class="wp-block-lh-mermaid-diagram mermaid">flowchart LR
A[Draft] --> B{Review}
B -->|Approved| C[Publish]</pre>
<!-- /wp:lh-mermaid/diagram -->
Inside the pre, escape < and & as entities. > may be written raw or as >; both draw the same.
lh_defer_javascript_exclude_scripts filter), because Mermaid draws on the page load event and a late-loaded library would draw nothing.There is no setting. To remove the block from the inserter somewhere, filter lh_mermaid_block_enabled, which receives $enabled, the post being edited and the editor context:
add_filter( 'lh_mermaid_block_enabled', function ( $enabled, $post ) {
return ( $post && 'page' === $post->post_type ) ? false : $enabled;
}, 10, 2 );