stefanstranger / logicappdocs

Generate technical Markdown documentation for your Azure Logic App and Power Automate Flows
MIT License
55 stars 4 forks source link

Mermaid diagram parse error #4

Closed imorrish closed 1 year ago

imorrish commented 1 year ago

My logic app results in the following mermaid diagram which has Parse error on line 3: ... subgraph For_each_|_Smart_Guest_Manage -----------------------^ Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'GRAPH', 'DIR', 'subgraph', 'SQS', 'end', 'AMP', 'ALPHA', 'COLON', 'TAGEND', 'START_LINK', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'DOWN', 'UP', 'DEFAULT', 'NUM', 'COMMA', 'MINUS', 'BRKT', 'DOT', 'PCT', 'TAGSTART', 'PUNCTUATION', 'UNICODE_TEXT', 'PLUS', 'EQUALS', 'MULT', 'UNDERSCORE', got 'PIPE'

Diagram output is: `

graph TB
    Trigger
    subgraph For_each_|_Smart_Guest_Management_|_Items
    direction TB
        Create_item_|_Smart_Guest_Management_Archive_|_Item
        Delete_item_|_Smart_Guest_Management
    end
    Get_items_|_Smart_Guest_Management --> For_each_|_Smart_Guest_Management_|_Items
    For_each_|_Smart_Guest_Management_|_Items --> Create_item_|_Smart_Guest_Management_Archive_|_Item
    Create_item_|_Smart_Guest_Management_Archive_|_Item --> Delete_item_|_Smart_Guest_Management
    Trigger --> Get_items_|_Smart_Guest_Management

`

stefanstranger commented 1 year ago

Hi Ian,

Thanks for using my logicappsdocs solution 🙏and helping me with fixing issues. Your issue is being caused by the pipe character "|" in the names of your Logic App Actions.

Mermaid cannot handle certain characters. When I removed the pipe character from the Mermaid code it worked as expected.

See here in the Mermaid live editor

The way to resolve this is that I add a search and replace action for all the actions that contain this character. Are you fine with that solution?

Regards, Stefan

imorrish commented 1 year ago

Thanks for looking into that. I had found plenty of other examples regarding "special characters" but guess | is too special. I'

stefanstranger commented 1 year ago

Let me re-open the issue and close it when I've implemented the fix.

stefanstranger commented 1 year ago

Closed after merging branch that fixed the error.