bpruitt-goddard / vscode-mermaid-syntax-highlight

Markdown syntax support for the Mermaid charting language
MIT License
92 stars 35 forks source link

Feature Request: Support Syntax Highlighting for pandoc code blocks #117

Closed jorlando-tuik closed 10 months ago

jorlando-tuik commented 11 months ago

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.

jorlando-tuik commented 11 months ago

Submitted https://github.com/bpruitt-goddard/vscode-mermaid-syntax-highlight/pull/116

jorlando-tuik commented 11 months ago

Looks like https://github.com/bpruitt-goddard/vscode-mermaid-syntax-highlight/pull/92 does the same, but actually adds a test case.

bpruitt-goddard commented 10 months ago

Closing this as it was fixed with #119.