File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ let utf8_length s =
143
143
let str_as n s =
144
144
let stack = Box_debug. get_stack () in
145
145
with_pp (fun fs ->
146
- Box_debug. start_str fs ;
146
+ Box_debug. start_str fs s ;
147
147
Format_. pp_print_as fs n s ;
148
148
Box_debug. end_str ~stack fs )
149
149
Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ let css =
42
42
.fits_or_breaks {
43
43
background- color : red ;
44
44
}
45
+ .string_with_whitespaces {
46
+ background- color : yellow ;
47
+ white- space : pre ;
48
+ }
49
+
45
50
.tooltiptext {
46
51
visibility : hidden ;
47
52
width : min - content;
@@ -132,7 +137,15 @@ let force_newline ?stack fs =
132
137
debugf fs " <div class=\" break force_newline\" >force_newline%a</div>"
133
138
stack_tooltip stack
134
139
135
- let start_str fs = debugf fs " <span class='string'>"
140
+ let start_str fs s =
141
+ let extra_class =
142
+ match String. lfindi s ~f: (fun _ c -> Char. is_whitespace c) with
143
+ | Some _ ->
144
+ (* String contains whitespaces, color it *)
145
+ " string_with_whitespaces"
146
+ | None -> " "
147
+ in
148
+ debugf fs " <span class='string%s'>" extra_class
136
149
137
150
let end_str ?stack fs = debugf fs " %a</span>" stack_tooltip stack
138
151
You can’t perform that action at this time.
0 commit comments