We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d1abe7 commit daf33a9Copy full SHA for daf33a9
pandas/io/formats/css.py
@@ -21,18 +21,21 @@
21
22
23
def _normalize_number_format_value(value: str) -> str:
24
- value = value.strip()
25
- out: list[str] = []
26
- in_string = False
+ out = []
+ in_single = False
+ in_double = False
27
28
- for ch in value:
29
- if ch == '"':
+ for ch in value.strip():
+ if ch == "'" and not in_double:
30
+ in_single = not in_single
31
+ out.append(ch)
32
+ elif ch == '"' and not in_single:
33
+ in_double = not in_double
34
35
+ elif in_single or in_double:
36
out.append(ch)
- in_string = not in_string
- elif in_string:
- out.append(ch) # preserve case inside string literals
37
else:
- out.append(ch.lower()) # normalize outside literals
38
+ out.append(ch.lower())
39
return "".join(out)
40
41
0 commit comments