




























@@ -145,20 +145,17 @@ describe("toSanitizedMarkdownHtml", () => {
145145146146it("does NOT link bare domains without www", () => {
147147const html = toSanitizedMarkdownHtml("Visit google.com today");
148-expect(html).not.toContain("<a");
149-expect(html).toContain("google.com");
148+expect(html).toBe("<p>Visit google.com today</p>\n");
150149});
151150152151it("does NOT link filenames with TLD-like extensions", () => {
153152const html = toSanitizedMarkdownHtml("Check README.md and config.json");
154-expect(html).not.toContain("<a");
155-expect(html).toContain("README.md");
153+expect(html).toBe("<p>Check README.md and config.json</p>\n");
156154});
157155158156it("does NOT link IP addresses", () => {
159157const html = toSanitizedMarkdownHtml("Check 127.0.0.1:8080");
160-expect(html).not.toContain("<a");
161-expect(html).toContain("127.0.0.1:8080");
158+expect(html).toBe("<p>Check 127.0.0.1:8080</p>\n");
162159});
163160164161it("keeps adjacent trailing CJK text outside www auto-links", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。