Add edit button for Mermaid diagrams in Live Preview

Use case or problem

When editing Mermaid diagrams from a mobile device in Live Preview, it’s very difficult to move the cursor into the code block so you can edit the data. On iOS, hold and slide on the spacebar does not work to move the cursor into the code block.

OS: iOS 27.2
Obsidian version: 1.15 (with new Pele library)

Proposed solution

Add an “edit button” for easy access to the underlying code block, similar to the button added for images in Obsidian 1.13, which will open the code block.

Current workaround (optional)

Switch to Source mode so I can edit the code block, or add the Move caret up/down commands to the mobile toolbar.

Related feature requests (optional)

On iOS, I’m able to tap the top right of the mermaid block and it goes into edit mode, but it may be hard to tell where the exact top right of it is.

In the meantime, you can use a css snippet to show the edit block button in the top corner. Adjust the opacity as desired.

.is-mobile .markdown-source-view.mod-cm6 .cm-lang-mermaid .embed-actions {
    opacity: 0.2; 
}

An edit button for Mermaid blocks would make editing much easier on mobile. Switching to Source mode is useful, but direct editing in Live Preview would be more convenient.