Skip to content

Unable to integrate with markdown-it as plugin #9

@julianlam

Description

@julianlam

Hi there. Looking at #4, I was able to get the plugin registered with markdown-it, but as it stands right now it is not doing anything.

Here is my code:

// `parser` is the object you get from `new MarkdownIt()`
parser.use(require('markdown-it-mermaid').default);

console.log(parser.render(`\`\`\`mermaid
graph TD
	A[Christmas] -->|Get money| B(Go shopping)
	B --> C{Let me think}
	C -->|One| D[Laptop]
	C -->|Two| E[iPhone]
	C -->|Three| F[Car]
\`\`\``));

The following code is output:

<div class="mermaid">graph TD
        A[Christmas] -->|Get money| B(Go shopping)
        B --> C{Let me think}
        C -->|One| D[Laptop]
        C -->|Two| E[iPhone]
        C -->|Three| F[Car]</div>

So it doesn't look like it's generating any SVG code... unless I am misunderstanding something with the implementation?

Thanks for any help you can provide!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions