Merge pull request #4160 from mermaid-js/sidv/fix4157
fix #4157: Inject only fontFamily without replacing themeVariables
This commit is contained in:
commit
114ab87816
|
@ -9,7 +9,7 @@ https://mkdocs.org/
|
||||||
https://osawards.com/javascript/#nominees
|
https://osawards.com/javascript/#nominees
|
||||||
https://osawards.com/javascript/2019
|
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_
|
https://twitter.com/mermaidjs_
|
||||||
|
|
||||||
# Don't check files that are generated during the build via `pnpm docs:code`
|
# Don't check files that are generated during the build via `pnpm docs:code`
|
||||||
|
|
|
@ -95,7 +95,7 @@ mermaid.initialize(config);
|
||||||
|
|
||||||
#### Defined in
|
#### 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
|
## Functions
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,10 @@ const render = async function (
|
||||||
function initialize(options: MermaidConfig = {}) {
|
function initialize(options: MermaidConfig = {}) {
|
||||||
// Handle legacy location of font-family configuration
|
// Handle legacy location of font-family configuration
|
||||||
if (options?.fontFamily && !options.themeVariables?.fontFamily) {
|
if (options?.fontFamily && !options.themeVariables?.fontFamily) {
|
||||||
options.themeVariables = { fontFamily: options.fontFamily };
|
if (!options.themeVariables) {
|
||||||
|
options.themeVariables = {};
|
||||||
|
}
|
||||||
|
options.themeVariables.fontFamily = options.fontFamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set default options
|
// Set default options
|
||||||
|
|
Loading…
Reference in New Issue