Skip to content

Commit 80fd8c4

Browse files
committed
fix: normalize bare-string tags to array in parseFrontmatter
When frontmatter contains tags: single-value without bracket syntax, the generic parser assigned a plain string to result.tags. Downstream consumers iterate with for...of which on a string yields individual characters, producing garbled single-character tag categories in catalog and corrupted BM25 search index data. Normalize to a single-element array after parsing.
1 parent 0db2f6b commit 80fd8c4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

workers/src/zip-baseline-fetcher.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ function parseFrontmatter(content: string): FrontmatterResult {
132132
result[key] = value;
133133
}
134134

135+
if (typeof result.tags === "string") {
136+
result.tags = [result.tags];
137+
}
138+
135139
return result;
136140
}
137141

0 commit comments

Comments
 (0)