import { describe, expect, it } from "vitest"; import { renderJianshuHtmlImagesAsMarkdown } from "../../../../../packages/publisher-platforms/src/jianshu"; describe("jianshu article content", () => { it("converts editor image paragraphs to markdown image syntax", () => { const result = renderJianshuHtmlImagesAsMarkdown( '

', ); expect(result).toBe("![](https://upload-images.jianshu.io/upload_images/2370478-707abbd68000b249.png)"); }); it("keeps normal text while replacing raw image tags", () => { const result = renderJianshuHtmlImagesAsMarkdown( '

正文段落

微信图片_2026-04-18_141100_730.jpg', ); expect(result).toContain("

正文段落

"); expect(result).toContain( "![微信图片_2026-04-18_141100_730.jpg](https://upload-images.jianshu.io/upload_images/2370478-0e05fd986e33dae9.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)", ); expect(result).not.toContain("