mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-04 22:59:50 +02:00
fix #4157: Inject only fontFamily without replacing themeVariables
This commit is contained in:
@@ -95,7 +95,7 @@ mermaid.initialize(config);
|
||||
|
||||
#### Defined in
|
||||
|
||||
[mermaidAPI.ts:680](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L680)
|
||||
[mermaidAPI.ts:683](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L683)
|
||||
|
||||
## Functions
|
||||
|
||||
|
@@ -579,7 +579,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
|
||||
|
Reference in New Issue
Block a user