fix(salary): collapse line breaks in wrapped workbook headers (#643)

* fix(salary): collapse line breaks in wrapped workbook headers

A wrapped header cell ("Median\nsalary", "Løn-\nindeks") kept its line
break, so the converter derived a category name containing a newline:
the column no longer paired with its count column, and salary_lookup
printed the category label across two lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): record fix for #643

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* changelog: place the #643 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 19:50:53 +02:00
1 parent 51c7dfdbd7
commit 1ec64d243c
3 files changed
+60 -2

No files matched your search

+4 -2
View File
@@ -186,10 +186,12 @@ def parse_sheet(ws, sheet_label=None):
print(f"Warning: Could not find header row in sheet '{ws.title}'. Skipping.", file=sys.stderr)
return []
# Read headers
# Read headers. Wrapped header cells carry a line break ("Median\nsalary"),
# which would survive into the category name and keep the column from
# pairing with its count, so collapse every whitespace run to one space.
headers = []
for cell in ws[header_row]:
headers.append(str(cell.value).strip() if cell.value else "")
headers.append(" ".join(str(cell.value).split()) if cell.value else "")
# Find company and city columns
company_col = None