mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 14:04:58 +00:00
test: prune redundant markdown extractor plain-text negatives
This commit is contained in:
@@ -139,15 +139,6 @@ echo "world"
|
|||||||
expect(codeBlocks[0].language).toBe("python");
|
expect(codeBlocks[0].language).toBe("python");
|
||||||
expect(codeBlocks[1].language).toBe("bash");
|
expect(codeBlocks[1].language).toBe("bash");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns empty when no code blocks present", () => {
|
|
||||||
const text = "No code here, just text.";
|
|
||||||
|
|
||||||
const { codeBlocks, textWithoutCode } = extractCodeBlocks(text);
|
|
||||||
|
|
||||||
expect(codeBlocks).toHaveLength(0);
|
|
||||||
expect(textWithoutCode).toBe(text);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("extractLinks", () => {
|
describe("extractLinks", () => {
|
||||||
@@ -161,15 +152,6 @@ describe("extractLinks", () => {
|
|||||||
expect(links[1]).toEqual({ text: "GitHub", url: "https://github.com" });
|
expect(links[1]).toEqual({ text: "GitHub", url: "https://github.com" });
|
||||||
expect(textWithLinks).toBe("Check out Google and GitHub.");
|
expect(textWithLinks).toBe("Check out Google and GitHub.");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles text without links", () => {
|
|
||||||
const text = "No links here.";
|
|
||||||
|
|
||||||
const { links, textWithLinks } = extractLinks(text);
|
|
||||||
|
|
||||||
expect(links).toHaveLength(0);
|
|
||||||
expect(textWithLinks).toBe(text);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("stripMarkdown", () => {
|
describe("stripMarkdown", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user