Skip to content

Commit

Permalink
spread the config with init config so diagram doesn't get impacted
Browse files Browse the repository at this point in the history
  • Loading branch information
ad1992 committed Jul 10, 2024
1 parent 5ae13fe commit fbc407d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const parseMermaidToExcalidraw = async (
const fontSize =
parseInt(mermaidConfig.themeVariables?.fontSize ?? "") || DEFAULT_FONT_SIZE;
const parsedMermaidData = await parseMermaid(definition, {
...config,
...mermaidConfig,
themeVariables: {
...mermaidConfig.themeVariables,
// Multiplying by 1.25 to increase the font size by 25% and render correctly in Excalidraw
Expand Down
2 changes: 1 addition & 1 deletion src/parseMermaid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const parseMermaid = async (
definition: string,
config: MermaidConfig = MERMAID_CONFIG
): Promise<Flowchart | GraphImage | Sequence | Class> => {
mermaid.initialize(config);
mermaid.initialize({ ...MERMAID_CONFIG, ...config });
// Parse the diagram
const diagram = await mermaid.mermaidAPI.getDiagramFromText(
encodeEntities(definition)
Expand Down

0 comments on commit fbc407d

Please sign in to comment.