From e7935b07c41c312fbe7ea138a553dcb0c06450e2 Mon Sep 17 00:00:00 2001 From: Torben Ewert Date: Fri, 22 May 2026 09:03:18 +0200 Subject: [PATCH] fix: print multiline html attributes with fewer breaks --- lib/pinc_format/Formatter.ml | 4 +++- test/slot/run.t | 12 +++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/pinc_format/Formatter.ml b/lib/pinc_format/Formatter.ml index 12cb402..b944558 100644 --- a/lib/pinc_format/Formatter.ml +++ b/lib/pinc_format/Formatter.ml @@ -48,7 +48,9 @@ and format_html_attributes format = function ^^ rbrace | _ -> format value in - nest 2 (ifflat empty (break 1) ^^ string key ^^ equals ^^ formatted_value)) + nest + 2 + (ifflat empty (break 1) ^^ group (string key ^^ equals ^^ formatted_value))) lst in group (separate space lst) diff --git a/test/slot/run.t b/test/slot/run.t index 3164dcd..fac60cd 100644 --- a/test/slot/run.t +++ b/test/slot/run.t @@ -54,15 +54,9 @@ {if (record.a > 9) { Yaaay! }} -- 2.51.2