Serialize the #This Row section specifier in title case#49
Open
gthb wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
stringifyStructRefserializes the#This Rowsection 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-casedrowis off-canonical.Excel does tolerate the different case on load (the keyword is matched case-insensitively) and normalizes it back to
#This Rowon 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.