Skip to content

Commit

Permalink
fix: fix usage of wrong regex match group
Browse files Browse the repository at this point in the history
The current regex match group we're using to get the mermaid diagrams
from markdown prepends a `\n` character to every mermaid diagram.

This only currently works because the current
mmdc -> HTML -> mermaid.init step removes these newlines automatically.
  • Loading branch information
aloisklink authored and MindaugasLaganeckas committed May 8, 2023
1 parent 976ce67 commit 55d72d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ async function run (input, output, { puppeteerConfig = {}, quiet = false, output
if (input && /\.(md|markdown)$/.test(input)) {
const imagePromises = []
for (const mermaidCodeblockMatch of definition.matchAll(mermaidChartsInMarkdownRegexGlobal)) {
const mermaidDefinition = mermaidCodeblockMatch[1]
const mermaidDefinition = mermaidCodeblockMatch[2]

/** Output can be either a template image file, or a `.md` output file.
* If it is a template image file, use that to created numbered diagrams
Expand Down

0 comments on commit 55d72d7

Please sign in to comment.