mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:11:36 +00:00
fix: anchor MEDIA tag parsing
This commit is contained in:
@@ -34,4 +34,17 @@ describe("splitMediaFromOutput", () => {
|
||||
expect(first.audioAsVoice).toBe(true);
|
||||
expect(second.audioAsVoice).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps MEDIA mentions in prose", () => {
|
||||
const input = "The MEDIA: tag fails to deliver";
|
||||
const result = splitMediaFromOutput(input);
|
||||
expect(result.mediaUrls).toBeUndefined();
|
||||
expect(result.text).toBe(input);
|
||||
});
|
||||
|
||||
it("parses MEDIA tags with leading whitespace", () => {
|
||||
const result = splitMediaFromOutput(" MEDIA:/tmp/screenshot.png");
|
||||
expect(result.mediaUrls).toEqual(["/tmp/screenshot.png"]);
|
||||
expect(result.text).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user