forked from EduCraft/curriculum-project-hub
fix(hub): strip card markdown images + prefer inline ![] over send_file
Feishu interactive markdown rejects  without image_key (error 230099 empty/missing imagekey). Always mask residual image md in card builders; skip img tags with empty keys; skip inline-code examples; fetch remote images with a browser UA and without env HTTP_PROXY. Steer the agent: use  for 图文, send_file only for downloadable attachments. Release v0.0.37.
This commit is contained in:
@@ -42,6 +42,12 @@ describe("outbound markdown image parsing", () => {
|
||||
);
|
||||
expect(maskMarkdownImagesForStreaming("")).toBe("【图片】");
|
||||
});
|
||||
|
||||
it("ignores markdown image examples inside inline code", () => {
|
||||
const text = "例如 `` 这样写,不会当真实图片";
|
||||
expect(findMarkdownImagesOutsideCode(text)).toEqual([]);
|
||||
expect(maskMarkdownImagesForStreaming(text)).toBe(text);
|
||||
});
|
||||
});
|
||||
|
||||
describe("materializeAnswerSegments", () => {
|
||||
|
||||
Reference in New Issue
Block a user