[patch] Keep both values when two keys standardize to the same name - #156
Merged
Merged
Conversation
NameStandardizer wrote each renamed property with a plain indexer, so when two keys resolved to one standard name (author + creator, Title + title) the later silently overwrote the earlier. With the default options a document carrying both author and creator lost its author. A key is now renamed only when its standard name is free: not already written and not the exact name of a key still to come. Otherwise it keeps its original name. The lower-casing branch goes through the same guard. Fixes #136 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KrGyxYxnoFgAkP1ENResCJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KrGyxYxnoFgAkP1ENResCJ
|
This was referenced Sep 28, 2026
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.



Fixes #136
Problem
NameStandardizer.StandardizePropertyNameswrote each renamed property withstandardizedFrontmatter[name] = value. When two keys resolved to the same standard name, the later one overwrote the earlier one without any warning. With the default options, a document carrying bothauthorandcreatorlost its author.Change
All in
Frontmatter/NameStandardizer.cs:GetStandardName. The rules are the same as before.Title→title) goes through the same guard.Tests
StandardNamingCollisionTests. It covers the three rows in the issue, plus the alias-before-standard-name order and a check that a lone alias is still renamed.NameStandardizer.csreverted, the four collision tests fail. The lone-alias test passes either way, as expected.Notes
main.PropertyMergerand is not touched here.🤖 Generated with Claude Code
https://claude.ai/code/session_01KrGyxYxnoFgAkP1ENResCJ
Generated by Claude Code