mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-31 14:16:39 +01:00
Match full visible content and exact link destinations while retaining source Markdown and native run attribution. Preserve the original browser regression and strengthen decline source checks. Co-Authored-By: Paperclip <noreply@paperclip.ing>
15 lines
817 B
TypeScript
15 lines
817 B
TypeScript
import { expect, it } from "vitest";
|
|
import { taskReplyContentMatches } from "./task-reply-content.js";
|
|
|
|
it("parses CommonMark escapes, entities, inline formatting and paragraph boundaries", () => {
|
|
expect(taskReplyContentMatches({ body: "Couldn't retrieve a_b & c. No retry." },
|
|
"**Couldn't retrieve** `a_b` & c.\n\nNo _retry_.")).toBe(true);
|
|
expect(taskReplyContentMatches({ body: "Couldn't retrieve a_b & c. No retry. Extra." },
|
|
"**Couldn't retrieve** `a_b` & c.\n\nNo _retry_.")).toBe(false);
|
|
});
|
|
|
|
it("rejects unsupported Markdown rather than stripping unknown or invisible content", () => {
|
|
for (const source of ["Visible <!-- hidden -->", "Visible ", "~~Visible~~"])
|
|
expect(taskReplyContentMatches({ body: "Visible" }, source)).toBe(false);
|
|
});
|