Support mermaid diagram preview

Randal Peters's Avatar

Randal Peters

26 Feb, 2025 04:14 AM

// Please enter a detailed description of the issue // Description of the issue:

Trying to display a mermaid diagram

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

  1. Enter a mermaid sample diagram
  2. Preview the .md file
  3. Only shows the mermaid code and not the diagram

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 1067 (Setapp)

macOS Version: 15.3.1

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: swiss
defaultProcessor: MultiMarkdown
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: NO
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: NO
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

  1. Support Staff 1 Posted by Brett on 07 Mar, 2025 03:19 PM

    Brett's Avatar

    You can manually add scripts to your Markdown files, or add them via a custom processor with a little coding knowledge.

    I'm not going to build Mermaid into Marked, but the next update that's coming out has features for inserting custom javascript in every preview, as well as instructions for including Mermaid and updating it on every refresh. (If you include it manually you'll find that you have to hit ⌘R to get the diagram to update.)

    Watch for the new release in the next couple of weeks.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac