#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
1 changed files with 4 additions and 3 deletions

View File

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