#3680 Add font familiy in a way that does remove other configuration

This commit is contained in:
Knut Sveidqvist
2022-10-17 10:51:41 +02:00
parent 752a6b2cb0
commit e86d7894f5

View File

@@ -455,10 +455,11 @@ const handleDirective = function (p: any, directive: any, type: string): void {
/** @param {MermaidConfig} options */ /** @param {MermaidConfig} options */
async function initialize(options: MermaidConfig) { async function initialize(options: MermaidConfig) {
// Handle legacy location of font-family configuration // Handle legacy location of font-family configuration
if (options?.fontFamily) { if (options.fontFamily) {
if (!options.themeVariables?.fontFamily) { if (!options.themeVariables) {
options.themeVariables = { fontFamily: options.fontFamily }; options.themeVariables = {};
} }
options.themeVariables.fontFamily = options.fontFamily;
} }
// Set default options // Set default options