Skip to content

How to integrate support for Mermaid rendering?ย #3323

@bbhxwl

Description

@bbhxwl

How to integrate support for Mermaid rendering?
My server rendered the blog in this way

const file = await unified()
        .use(remarkParse)
        .use(remarkGfm) //  ๅพ…ๅŠžใ€ๅˆ ้™ค็บฟใ€่กจๆ ผโ€ฆ
        .use(rehypeMermaid, {
            // The default strategy is 'inline-svg'
            // strategy: 'img-png'
            // strategy: 'img-svg'
            // strategy: 'inline-svg'
            // strategy: 'pre-mermaid'
        })
        .use(remarkRehype)
        .use(rehypePrettyCode, {
            transformers: [
                transformerCopyButton({
                    visibility: 'always',
                    feedbackDuration: 3_000,
                }),
            ],
        })
        .use(rehypeStringify)
        .process(markdown);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions