Skip to content

Serialize the #This Row section specifier in title case#49

Open
gthb wants to merge 1 commit into
borgar:masterfrom
gthb:fix-this-row-casing
Open

Serialize the #This Row section specifier in title case#49
gthb wants to merge 1 commit into
borgar:masterfrom
gthb:fix-this-row-casing

Conversation

@gthb

@gthb gthb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

stringifyStructRef serializes the #This Row section specifier as #This row.

Fix it to emit #This Row (both words capitalized), matching Excel's canonical form.

Why

Excel always writes [#This Row] in stored formulas, so the lower-cased row is off-canonical.

Excel does tolerate the different case on load (the keyword is matched case-insensitively) and normalizes it back to #This Row on save. So this is low-severity, just a matter of matching the canonical form, not of valid vs invalid.

How

Replace the sentence-case helper with a per-word title-case, so each word of a section specifier is capitalized. The tokenizer and parser already preserve/accept #This Row; only the object-to-string path was off.

stringifyStructRef sentence-cased section specifiers: it upper-cased the
first letter and lower-cased the rest. That is correct for the single-word
specifiers (#All, #Data, #Headers, #Totals) but wrong for the two-word
#This Row, which came out as "#This row".

Excel's canonical serialization is "#This Row" (both words capitalized), and
a lower-cased "row" is off-canonical, so title-case each word instead.
@gthb gthb marked this pull request as ready for review July 9, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant