mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 22:26:53 +00:00
refactor: split telegram delivery and unify media/frontmatter/i18n pipelines
This commit is contained in:
@@ -68,6 +68,35 @@ metadata:
|
||||
expect(parsed.openclaw?.events).toEqual(["command:new"]);
|
||||
});
|
||||
|
||||
it("preserves inline description values containing colons", () => {
|
||||
const content = `---
|
||||
name: sample-skill
|
||||
description: Use anime style IMPORTANT: Must be kawaii
|
||||
---`;
|
||||
const result = parseFrontmatterBlock(content);
|
||||
expect(result.description).toBe("Use anime style IMPORTANT: Must be kawaii");
|
||||
});
|
||||
|
||||
it("does not replace YAML block scalars with block indicators", () => {
|
||||
const content = `---
|
||||
name: sample-skill
|
||||
description: |-
|
||||
{json-like text}
|
||||
---`;
|
||||
const result = parseFrontmatterBlock(content);
|
||||
expect(result.description).toBe("{json-like text}");
|
||||
});
|
||||
|
||||
it("keeps nested YAML mappings as structured JSON", () => {
|
||||
const content = `---
|
||||
name: sample-skill
|
||||
metadata:
|
||||
openclaw: true
|
||||
---`;
|
||||
const result = parseFrontmatterBlock(content);
|
||||
expect(result.metadata).toBe('{"openclaw":true}');
|
||||
});
|
||||
|
||||
it("returns empty when frontmatter is missing", () => {
|
||||
const content = "# No frontmatter";
|
||||
expect(parseFrontmatterBlock(content)).toEqual({});
|
||||
|
||||
Reference in New Issue
Block a user