We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d6b044 commit f5523f8Copy full SHA for f5523f8
graphviz2drawio/graphviz2drawio.py
@@ -59,10 +59,10 @@ def _load_pygraphviz_graph(
59
# is mistakenly identified as a filename.
60
# https://github.com/pygraphviz/pygraphviz/issues/536
61
pattern = re.compile(
62
- r"(?:\s*(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/|//[^\r\n]*|\#[^\r\n]*)\s*)*\s*(strict)?\s*(graph|digraph).*?\{.*\}\s*",
63
- re.DOTALL | re.MULTILINE | re.VERBOSE,
+ pattern=r"^\s*(strict)?\s*(graph|digraph).*{",
+ flags=re.DOTALL | re.MULTILINE,
64
)
65
- if pattern.match(graph_to_convert):
+ if pattern.search(graph_to_convert):
66
return AGraph(string=graph_to_convert)
67
return AGraph(filename=graph_to_convert)
68
# pyrefly: ignore # missing-attribute
0 commit comments