Add mermaid to opening code fences without changing closing fences.
Adds mermaid immediately AFTER an opening backtick fence, producing ```mermaid. Closing fences remain unchanged.
.obsidian, then plugins (create plugins if needed).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.No build step, Node installation, or paid service is needed.
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.
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