Hello:
(edited to account for this editor removing doubled slashes)
I’ve got this mermaid notation output from my AI Agent. Problem is it is using this new line character which looks like this “\n” (single slash) but is actually an escaped version “\n” (double slash) under the hood as far as I can tell. I know this because vscode search and replace function only recognizes “\n” (double slash) when I replace it with actual (shift+enter) line breaks. I’ve tried so many variations of scripts to replace this “\n” (double slash) with something else that will trigger an actual line break when pasting into a mermaid preview. I’ve even tried spreading out the mermaid chunk into an array before running it through scripts…still no luck.
Anyone have any ideas or techniques to get this mermaid blob to render new lines without external processing like vscode find/replace?
Thanks for your time.
What I have:
What I need:
Text version for your convenience---------------------------------------
graph TD;\n A[Start] → B[Step 1]\n B → C[Step 2]\n C → D{Condition?}\n D – Yes → E[Step 3]\n D – No → F[Step 4]\n F → D\n E → G[Step 5]\n G → H[Step 6]\n H → I{End Condition?}\n I – Yes → J[Step 7]\n J → H\n I – No → K[End]\n K → L[Document Observations]\n L → M[End]