From bb476d39015283b2be9f7b54d2ad2b2d4dd1fa91 Mon Sep 17 00:00:00 2001 From: Oddegamra <637610+Oddegamra@users.noreply.github.com> Date: Thu, 12 Jun 2025 10:10:56 +0200 Subject: [PATCH] fix: Initialize D2Scale configuration member The D2Scale property of MarkConfig was never initialized, leading to a default value of 0 being passed to the D2 renderer. This eventually led to calling chromedp.ScreenshotScale with a scale value of 0. Chrome doesn't like this, and never finishes the sceenshot operation. Fixes #610 --- util/cli.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cli.go b/util/cli.go index 3dbfaae..e61535b 100644 --- a/util/cli.go +++ b/util/cli.go @@ -222,6 +222,7 @@ func processFile( cfg := types.MarkConfig{ MermaidProvider: cmd.String("mermaid-provider"), MermaidScale: cmd.Float("mermaid-scale"), + D2Scale: cmd.Float("d2-scale"), DropFirstH1: cmd.Bool("drop-h1"), StripNewlines: cmd.Bool("strip-linebreaks"), Features: cmd.StringSlice("features"), @@ -301,6 +302,7 @@ func processFile( cfg := types.MarkConfig{ MermaidProvider: cmd.String("mermaid-provider"), MermaidScale: cmd.Float("mermaid-scale"), + D2Scale: cmd.Float("d2-scale"), DropFirstH1: cmd.Bool("drop-h1"), StripNewlines: cmd.Bool("strip-linebreaks"), Features: cmd.StringSlice("features"),