RoseSecurity / Terramaid

A utility for generating Mermaid diagrams from Terraform configurations
Apache License 2.0
275 stars 7 forks source link

Parse Error when rendering #47

Open guicane opened 2 months ago

guicane commented 2 months ago

Describe the bug Trying Terramaid for the first time and when seeing the preview in IntelliJ with the mermaid plugin installed I get a parse error. Relatively simple terraform configuration. Seems to fail when loading the google cloud terraform module.

Parse error on line 5:
...     subgraph Provider[\Registry.terraform
----------------------^
Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'GRAPH', 'DIR', 'subgraph', 'SQS', 'end', 'AMP', 'COLON', 'START_LINK', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'DOWN', 'UP', 'NUM', 'NODE_STRING', 'BRKT', 'MINUS', 'MULT', 'UNICODE_TEXT', got 'INVTRAPSTART'

To Reproduce Preview the output file Terramaid.md in IntelliJ (with mermaid extension installed) throws the error.

Expected behavior I should be able to see the graph.

Screenshots

Screenshot 2024-08-29 at 12 26 42
RoseSecurity commented 2 months ago

Thanks for reporting this @guicane. Is there any way you would be able to provide the markdown in this thread so I can copy it out and work on a fix?

RoseSecurity commented 3 weeks ago

Tracking this: https://linear.app/rosesecurity/issue/DEV-10/parse-error-when-rendering

RoseSecurity commented 1 day ago

I initially attempted a quick fix for this without success, but it is my next priority to get this working in a better way. I think it may require a major rewrite of how the logic converts DOT into Mermaid, but it is best for the longevity of the project to accomplish this in a cleaner and more sustainable way.

Thank you for your patience!