fix: preserve inline frontmatter values
This commit is contained in:
@@ -12,6 +12,7 @@ Docs: https://docs.clawd.bot
|
||||
|
||||
### Fixes
|
||||
- Doctor: avoid re-adding WhatsApp ack reaction config when only legacy auth files exist. (#1087) — thanks @YuriNachos.
|
||||
- Hooks: parse multi-line/YAML frontmatter metadata blocks (JSON5-friendly). (#1114) — thanks @sebslight.
|
||||
- CLI: add WSL2/systemd unavailable hints in daemon status/doctor output.
|
||||
- Status: show both usage windows with reset hints when usage data is available. (#1101) — thanks @rhjoh.
|
||||
- Memory: probe sqlite-vec availability in `clawdbot memory status`.
|
||||
|
||||
@@ -123,7 +123,15 @@ export function parseFrontmatterBlock(content: string): ParsedFrontmatter {
|
||||
if (endIndex === -1) return {};
|
||||
const block = normalized.slice(4, endIndex);
|
||||
|
||||
const lineParsed = parseLineFrontmatter(block);
|
||||
const yamlParsed = parseYamlFrontmatter(block);
|
||||
if (yamlParsed !== null) return yamlParsed;
|
||||
return parseLineFrontmatter(block);
|
||||
if (yamlParsed === null) return lineParsed;
|
||||
|
||||
const merged: ParsedFrontmatter = { ...yamlParsed };
|
||||
for (const [key, value] of Object.entries(lineParsed)) {
|
||||
if (value.startsWith("{") || value.startsWith("[")) {
|
||||
merged[key] = value;
|
||||
}
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user