chialiyun / DiagramsPreviewerVSCExt

Visual Studio Code Extension to preview Diagrams (Diagram as a Code)
MIT License
6 stars 0 forks source link

with Diagram() regex #11

Closed ruchevits closed 1 year ago

ruchevits commented 1 year ago

Current regex /^with Diagram\([\w\s:"'=.,\\\/]+\)\:/g won't match the following valid statements:

with Diagram():
with Diagram("Back-end architecture"):

Considering it can also be a variable within the parentheses:

name = "Back-end architecture"
with Diagram(name):

I propose to change it to /^with Diagram\(.*?\)\:/g and let the interpreter deal with the rest.