Mermaid Flowchart Diagram link to headers in the same note

Things I have tried

I have tried using the internal-link class, however that links to other notes in my vault.

I think in theory I could hack it using the click event, but that seems like a lot of work for what I want to accomplish.

What I’m trying to do

I am trying to get my mermaid flowchart diagram to link to other headings within my file with the same name as the display text, similar to the behavior of [[#heading]] linking to the heading of the same name within the file.