bpruitt-goddard/vscode-mermaid-syntax-highlight

Feature Request: Support Syntax Highlighting for pandoc code blocks

jorlando-tuik opened this issue · 3 comments

Request

Support syntax highlighting for the semi-official diagram-lua filter to generate diagrams for pandoc.

I am using the diagram-lua pandoc filter to generate images from mermaid for rendering into pdfs. The basic syntax is fine, but I need to use the pandoc syntax for mermaid code blocks so the filter can properly id images for pandoc-crossref. This breaks the currently mermaid detection and highlighting for the code block.

The following code snippet highlights as expected.

```mermaid
%%| caption: "Caption"
%%| alt: "Alt"
%%| name: "mermaid-pandoc-diagram-example"

flowchart TD
    A --> B

But the following does not.

```{.mermaid #fig:mermaid-pandoc-diagram-example height=60%}
%%| caption: "Caption"
%%| alt: "Alt"
%%| name: "mermaid-pandoc-diagram-example"

flowchart TD
    A --> B

I attached a pull request trying to get this working. I am sure I am missing many obvious steps.

Submitted #116

Looks like #92 does the same, but actually adds a test case.

Closing this as it was fixed with #119.