#3680 Add font familiy in a way that does remove other configuration
This commit is contained in:
parent
752a6b2cb0
commit
e86d7894f5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue