fix(timeline): load leftMargin from config

The `timeline.leftMargin` value in the docs/schema was not being
correctly loaded for timeline diagrams.
This commit is contained in:
Syn3ugar
2025-07-04 11:44:32 +08:00
committed by Alois Klink
parent 91f141f772
commit 637680d4d9
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
---
'mermaid': patch
---
fix(timeline): fix loading `leftMargin` from config
The `timeline.leftMargin` config value should now correctly control the size of the left margin, instead of being ignored.

View File

@@ -28,8 +28,7 @@ interface TimelineTask {
export const draw = function (text: string, id: string, version: string, diagObj: Diagram) {
//1. Fetch the configuration
const conf = getConfig();
// @ts-expect-error - wrong config?
const LEFT_MARGIN = conf.leftMargin ?? 50;
const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
log.debug('timeline', diagObj.db);