mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
Revert "fix: ensure configs from initialize and frontmatter are both handled correctly"
This reverts commit b7e9d02b7c
.
This commit is contained in:
@@ -82,7 +82,6 @@ describe('when working with site config', () => {
|
||||
describe('getUserDefinedConfig', () => {
|
||||
beforeEach(() => {
|
||||
configApi.reset();
|
||||
configApi.saveConfigFromInitialize({});
|
||||
});
|
||||
|
||||
it('should return empty object when no user config is defined', () => {
|
||||
@@ -107,6 +106,7 @@ describe('getUserDefinedConfig', () => {
|
||||
|
||||
expect(configApi.getUserDefinedConfig()).toMatchInlineSnapshot(`
|
||||
{
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": 14,
|
||||
"layout": "elk",
|
||||
"theme": "forest",
|
||||
@@ -128,8 +128,8 @@ describe('getUserDefinedConfig', () => {
|
||||
{
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": 14,
|
||||
"layout": "dagre",
|
||||
"theme": "dark",
|
||||
"layout": "elk",
|
||||
"theme": "forest",
|
||||
}
|
||||
`);
|
||||
});
|
||||
@@ -152,7 +152,7 @@ describe('getUserDefinedConfig', () => {
|
||||
{
|
||||
"flowchart": {
|
||||
"curve": "basis",
|
||||
"nodeSpacing": 50,
|
||||
"nodeSpacing": 75,
|
||||
"rankSpacing": 100,
|
||||
},
|
||||
"mindmap": {
|
||||
@@ -196,8 +196,8 @@ describe('getUserDefinedConfig', () => {
|
||||
expect(userConfig).toMatchInlineSnapshot(`
|
||||
{
|
||||
"flowchart": {
|
||||
"curve": "linear",
|
||||
"nodeSpacing": 50,
|
||||
"curve": "basis",
|
||||
"nodeSpacing": 100,
|
||||
"rankSpacing": 100,
|
||||
},
|
||||
"fontSize": 12,
|
||||
|
@@ -252,13 +252,13 @@ const checkConfig = (config: MermaidConfig) => {
|
||||
export const getUserDefinedConfig = (): MermaidConfig => {
|
||||
let userConfig: MermaidConfig = {};
|
||||
|
||||
for (const d of directives) {
|
||||
userConfig = assignWithDepth(userConfig, d);
|
||||
}
|
||||
|
||||
if (configFromInitialize) {
|
||||
userConfig = assignWithDepth(userConfig, configFromInitialize);
|
||||
}
|
||||
|
||||
for (const d of directives) {
|
||||
userConfig = assignWithDepth(userConfig, d);
|
||||
}
|
||||
|
||||
return userConfig;
|
||||
};
|
||||
|
Reference in New Issue
Block a user