Skip to content

Commit

Permalink
Merge pull request #4160 from mermaid-js/sidv/fix4157
Browse files Browse the repository at this point in the history
fix #4157: Inject only fontFamily without replacing themeVariables
  • Loading branch information
knsv committed Feb 28, 2023
2 parents b932cd0 + 4a6056b commit 114ab87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://mkdocs.org/
https://osawards.com/javascript/#nominees
https://osawards.com/javascript/2019

# Timeout error, maybe Twitter has anti-bot defences against GitHub's CI servers?
# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
https://twitter.com/mermaidjs_

# Don't check files that are generated during the build via `pnpm docs:code`
Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/modules/mermaidAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mermaid.initialize(config);

#### Defined in

[mermaidAPI.ts:659](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L659)
[mermaidAPI.ts:662](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L662)

## Functions

Expand Down
5 changes: 4 additions & 1 deletion packages/mermaid/src/mermaidAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ const render = async function (
function initialize(options: MermaidConfig = {}) {
// Handle legacy location of font-family configuration
if (options?.fontFamily && !options.themeVariables?.fontFamily) {
options.themeVariables = { fontFamily: options.fontFamily };
if (!options.themeVariables) {
options.themeVariables = {};
}
options.themeVariables.fontFamily = options.fontFamily;
}

// Set default options
Expand Down

0 comments on commit 114ab87

Please sign in to comment.