Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Mermaid Fence Helper

Atharva Savnerkar Atharva Savnerkar

Add mermaid to opening code fences without changing closing fences.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Adds mermaid immediately AFTER an opening backtick fence, producing ```mermaid. Closing fences remain unchanged.

Install on Windows

  1. Extract the ZIP.
  2. In your Obsidian vault folder, open .obsidian, then plugins (create plugins if needed).
  3. Copy the entire mermaid-fence-helper folder there. The files must be directly at .obsidian/plugins/mermaid-fence-helper/main.js and manifest.json, with no extra nested folder.
  4. Restart Obsidian. Open Settings → Community plugins, enable community plugins if needed, then enable Mermaid Fence Helper.

No build step, Node installation, or paid service is needed.

Use

Automatic mode is off by default for new installations. You can enable it in Settings → Mermaid Fence Helper. When enabled, pasting or editing a complete unlabeled code block starting with flowchart TD, graph LR, or another recognized Mermaid diagram declaration labels its opening fence automatically. Updating preserves your existing setting; turn it off in settings if it was previously enabled.

For existing notes: open the note in editing mode, press Ctrl+P, and choose Mermaid Fence Helper: Add mermaid to diagram blocks in this note.

If you want every unlabeled backtick block in the current note converted, use Mermaid Fence Helper: Add mermaid to ALL unlabeled blocks in this note. This also converts non-diagram blocks, so use it only in notes where that is intended. You can assign either command a shortcut under Settings → Hotkeys.

Behavior and limits

  • Only edits the current editor; does not scan or rewrite your whole vault.
  • Preserves closing fences, content, line endings, and existing language labels.
  • Handles multiple blocks, longer backtick fences, and blockquote/callout fences. Tilde blocks are tracked but not converted.
  • Waits for a complete pair of fences. A lone opening fence is left unchanged.
  • Automatic detection uses the first nonblank, non-comment line. Mermaid blocks with YAML configuration before their diagram declaration need the ALL command.
  • Fences in list items with more than three leading spaces are not supported.
  • Disable automatic mode in the plugin settings before undoing an automatic conversion; otherwise later edits can label it again.

Validated with automated parser and mocked Obsidian editor tests. Not tested inside a running Obsidian installation.

API reference: https://docs.obsidian.md/Plugins/Editor/Editor

HealthExcellent
ReviewPassed
About
Insert 'mermaid' immediately after an opening backtick fence to convert unlabeled code blocks into ```mermaid blocks. Detect common Mermaid diagram declarations when pasting or editing, or run note-level commands to add mermaid to diagram blocks or all unlabeled blocks while preserving closing fences and content.
CodeMarkdownAutomation
Details
Current version
1.0.3
Last updated
7 hours ago
Created
7 hours ago
Updates
2 releases
Compatible with
Obsidian 1.1.1+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
Atharva Savnerkar Atharva Savnerkar ayush4265
GitHubayush4265
  1. Community
  2. Plugins
  3. Code
  4. Mermaid Fence Helper

Related plugins

Templater

Create and use dynamic templates.

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

Auto Link Title

Automatically fetches the titles of links from the web.

Link Embed

Convert URLs in your notes into embeded previews.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.

BRAT

Easily install a beta version of a plugin for testing.

Advanced URI

Control everything with URI.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Custom Frames

Turn web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.

QuickAdd

Quickly add new notes or content to your vault.