Fix false positive IP address parsing

This commit is contained in:
Jon Staab
2024-09-30 16:22:55 -07:00
parent b27a389237
commit b12f4aec4d
+5
View File
@@ -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 {