Skip to content

Commit 7d7d580

Browse files
committed
test: leave plain domains unlinked
1 parent 81cd502 commit 7d7d580

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

ui/src/ui/markdown.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,17 @@ describe("toSanitizedMarkdownHtml", () => {
145145

146146
it("does NOT link bare domains without www", () => {
147147
const 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
});
151150

152151
it("does NOT link filenames with TLD-like extensions", () => {
153152
const 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
});
157155

158156
it("does NOT link IP addresses", () => {
159157
const 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
});
163160

164161
it("keeps adjacent trailing CJK text outside www auto-links", () => {

0 commit comments

Comments
 (0)