What's wrong
PropertyMerger groups every key, including singleton groups (PropertyMerger.cs:47-52), and runs each group through MergePropertyGroup. Any list value is routed to MergeArrayValues (line 158). That method collects items into a HashSet<object> (line 175), which drops duplicates within a single list, not just duplicates across the lists being merged.
Failure scenario
Input document, one frontmatter block, no colliding keys:
---
steps: [mix, wait, mix]
scores: [1, 1, 2]
---
With CombineFrontmatter under the default (Conservative) strategy, the output is:
steps: [mix, wait]
scores: [1, 2]
With FrontmatterMergeStrategy.None, both lists are preserved. Ordered lists that can legitimately repeat values (recipe steps, scores, playlists, repeated authors/contributors, and so on) lose data just from normalizing a single-block document. Nothing is being merged, so the user gets no warning.
Suggested fix / acceptance criteria
- Pass single-key groups through unchanged, since there is nothing to merge.
- When several keys really are merged, append the lists in order. Drop an item only if it already came from a different source list (or don't dedupe at all). Never dedupe within one list.
- Tests:
- A singleton
steps: [mix, wait, mix] round-trips unchanged through CombineFrontmatter.
- Merging
tags: [a, a] with tag: [b] keeps both a entries.
What's wrong
PropertyMergergroups every key, including singleton groups (PropertyMerger.cs:47-52), and runs each group throughMergePropertyGroup. Any list value is routed toMergeArrayValues(line 158). That method collects items into aHashSet<object>(line 175), which drops duplicates within a single list, not just duplicates across the lists being merged.Failure scenario
Input document, one frontmatter block, no colliding keys:
With
CombineFrontmatterunder the default (Conservative) strategy, the output is:With
FrontmatterMergeStrategy.None, both lists are preserved. Ordered lists that can legitimately repeat values (recipe steps, scores, playlists, repeated authors/contributors, and so on) lose data just from normalizing a single-block document. Nothing is being merged, so the user gets no warning.Suggested fix / acceptance criteria
steps: [mix, wait, mix]round-trips unchanged throughCombineFrontmatter.tags: [a, a]withtag: [b]keeps bothaentries.