From b12f4aec4d1d92f294a1e3668be69eec35277434 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 30 Sep 2024 16:22:55 -0700 Subject: [PATCH] Fix false positive IP address parsing --- packages/content/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/content/src/index.ts b/packages/content/src/index.ts index affce2c..d67dd19 100644 --- a/packages/content/src/index.ts +++ b/packages/content/src/index.ts @@ -224,6 +224,11 @@ export const parseLink = (text: string, context: ParseContext): ParsedLink | voi return } + // Skip it if it looks like an IP address but doesn't have a protocol + if (link.match(/\d+\.\d+/) && !link.includes('://')) { + return + } + // Parse using URL, make sure there's a protocol let url try {