Agently icon indicating copy to clipboard operation
Agently copied to clipboard

vscode 运行生成的mermaid语法报错

Open leaveblackgithub opened this issue 1 year ago • 1 comments

https://mermaid.live/代码: %%{ init: { 'flowchart': { 'curve': 'linear' }, 'theme': 'neutral' } }%% %% Rendered By Agently %% flowchart LR classDef chunk_style fill:#fbfcdb,stroke:#666,stroke-width:1px,color:#333; classDef condition_chunk_style fill:#ECECFF,stroke:#9370DB,stroke-width:1px,color:#333; classDef loop_style fill:#f5f7fa,stroke:#666,stroke-width:1px,color:#333,stroke-dasharray: 5 5 4a0d9fa3-a1bc-43c1-abc9-f10eee778bd4("START"):::chunk_style -.-> |"* -->-- default"| 94d567d7-1c7c-4b72-aa51-a0cad34f7e60("user_input"):::chunk_style 94d567d7-1c7c-4b72-aa51-a0cad34f7e60("user_input"):::chunk_style -.-> |"* -->-- default"| bb258f85-351e-4372-8d98-4c207f2b8c80("judge_intent_and_quick_reply"):::chunk_style bb258f85-351e-4372-8d98-4c207f2b8c80("judge_intent_and_quick_reply"):::chunk_style -.-> |"* -->-- default"| 653472f5-eff3-4255-b617-632934faaa89{{"Condition"}}:::condition_chunk_style 653472f5-eff3-4255-b617-632934faaa89{{"Condition"}}:::condition_chunk_style -.-> |"* -- ◇ -- default"| 5d4b239a-bc11-44ae-8177-17d1914bc4bc("@reply"):::chunk_style 5d4b239a-bc11-44ae-8177-17d1914bc4bc("@reply"):::chunk_style -.-> |"* -->-- default"| 995d23e1-3704-4ac9-9527-8596613ea6ee("END"):::chunk_style
653472f5-eff3-4255-b617-632934faaa89{{"Condition"}}:::condition_chunk_style -.-> |"* -- ◇ -- default"| 08aa5b57-7046-4bff-b2dc-3388005b90df("@reply"):::chunk_style 08aa5b57-7046-4bff-b2dc-3388005b90df("@reply"):::chunk_style -.-> |"* -->-- default"| 4d38474f-4da6-4b0a-a959-f9493e88376c("generate_after_sales_reply"):::chunk_style 4d38474f-4da6-4b0a-a959-f9493e88376c("generate_after_sales_reply"):::chunk_style -.-> |"* -->-- default"| 6a19a12a-e37e-492d-8699-ea8b0ef77b9e("@reply"):::chunk_style 6a19a12a-e37e-492d-8699-ea8b0ef77b9e("@reply"):::chunk_style -.-> |"* -->-- default"| 995d23e1-3704-4ac9-9527-8596613ea6ee("END"):::chunk_style
653472f5-eff3-4255-b617-632934faaa89{{"Condition"}}:::condition_chunk_style -.-> |"* -- ◇ -- default"| 5bd1cf79-61db-44f5-8553-2094ab302b31("generate_other_topic_reply"):::chunk_style 5bd1cf79-61db-44f5-8553-2094ab302b31("generate_other_topic_reply"):::chunk_style -.-> |"* -->-- default"| a8c0c8cf-e88d-4a4b-b5fe-257e8fc84838("@reply"):::chunk_style a8c0c8cf-e88d-4a4b-b5fe-257e8fc84838("@reply"):::chunk_style -.-> |"* -->-- default"| 995d23e1-3704-4ac9-9527-8596613ea6ee("END"):::chunk_style
错误信息:Error: Error: Parse error on line 5: ..."):::chunk_style 94d567d7-1c7c-4b72-a -----------------------^ Expecting 'SEMI', 'NEWLINE', 'EOF', 'AMP', 'START_LINK', 'LINK', got 'NUM'

CHATGPT-4O的修正建议: 在修正后的代码中,我做了以下调整:

分号:在loop_style定义的末尾添加了一个分号,以确保每个样式定义以分号结束,这是Mermaid的一个要求。

连接语法:修正了连接语法中的冗余符号,确保连接箭头的定义正确。例如,将冗余的-.->符号简化为-->。

条件分支标签:为条件分支添加了示例标签,如"Condition 1","Condition 2","Condition 3",以便更好地理解和示范条件逻辑。

leaveblackgithub avatar Aug 07 '24 06:08 leaveblackgithub