diff --git a/incorporealcms/mdx/pydot.py b/incorporealcms/mdx/pydot.py index a995905..db8cf8f 100644 --- a/incorporealcms/mdx/pydot.py +++ b/incorporealcms/mdx/pydot.py @@ -20,7 +20,7 @@ class InlinePydot(markdown.Extension): class InlinePydotPreprocessor(markdown.preprocessors.Preprocessor): """Identify dot codeblocks and run them through pydot.""" - BLOCK_RE = re.compile(r'~~~pydot:(?P[^\s]+)\n(?P.*?)~~~', re.DOTALL) + BLOCK_RE = re.compile(r'~~~{\s+pydot:(?P[^\s]+)\s+}\n(?P.*?)~~~', re.DOTALL) def run(self, lines): """Match and generate diagrams from dot code blocks.""" diff --git a/tests/instance/pages/test-graphviz.md b/tests/instance/pages/test-graphviz.md index c2ad5c3..b425c8e 100644 --- a/tests/instance/pages/test-graphviz.md +++ b/tests/instance/pages/test-graphviz.md @@ -1,7 +1,7 @@ # test test -~~~pydot:attack-plan +~~~{ pydot:attack-plan } digraph G { rankdir=LR Earth diff --git a/tests/instance/pages/test-invalid-graphviz.md b/tests/instance/pages/test-invalid-graphviz.md index 27727f8..8b3a08a 100644 --- a/tests/instance/pages/test-invalid-graphviz.md +++ b/tests/instance/pages/test-invalid-graphviz.md @@ -1,7 +1,7 @@ # test test -~~~pydot:attack-plan +~~~{ pydot:attack-plan } rankdir=LR Earth Mars diff --git a/tests/instance/pages/test-two-graphviz.md b/tests/instance/pages/test-two-graphviz.md index 97f7c31..df3ef48 100644 --- a/tests/instance/pages/test-two-graphviz.md +++ b/tests/instance/pages/test-two-graphviz.md @@ -2,7 +2,7 @@ test -~~~pydot:attack-plan +~~~{ pydot:attack-plan } digraph G { rankdir=LR Earth @@ -13,7 +13,7 @@ digraph G { more test -~~~pydot:new-attack-plan +~~~{ pydot:new-attack-plan } digraph H { rankdir=LR Venus