From 0a025adaae73f3c776b774419560d6ab23dd30f1 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Wed, 8 Jan 2025 15:34:43 +0100 Subject: [PATCH 1/2] diff view: translate \n to
--- lib/views.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/views.ml b/lib/views.ml index fcc6758..b43f919 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -827,9 +827,13 @@ let duniverse_diffs diffs = let opam_diffs diffs = List.concat_map (fun pd -> + let diff = + List.concat_map (fun line -> [ H.txt line ; H.br () ]) + (String.split_on_char '\n' pd.Opamdiff.diff) + in H.h4 [ txtf "%a" Opamdiff.pp_opam_diff pd ] :: H.h5 [ H.txt "diff" ] :: - H.code [ H.txt pd.diff ; H.br () ] :: []) + H.code diff :: []) diffs let compare_builds From e26af2dfdf126a55b6832f766870689f3d49f452 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Wed, 8 Jan 2025 17:00:00 +0100 Subject: [PATCH 2/2] as suggested by @reynir, use a pre --- lib/views.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/views.ml b/lib/views.ml index b43f919..f680024 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -827,13 +827,10 @@ let duniverse_diffs diffs = let opam_diffs diffs = List.concat_map (fun pd -> - let diff = - List.concat_map (fun line -> [ H.txt line ; H.br () ]) - (String.split_on_char '\n' pd.Opamdiff.diff) - in H.h4 [ txtf "%a" Opamdiff.pp_opam_diff pd ] :: H.h5 [ H.txt "diff" ] :: - H.code diff :: []) + H.pre [ H.code [ H.txt pd.diff ] ] :: + H.br () :: []) diffs let compare_builds