mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Allow getUrlsInString() to match urls that start mid-word with a protocol
This commit is contained in:
parent
ee3978797b
commit
4cf8c2ae92
1 changed files with 4 additions and 1 deletions
|
@ -387,7 +387,10 @@ export async function findRelevantAuditLogEntry(
|
|||
}
|
||||
}
|
||||
|
||||
const urlRegex = /(\S+\.\S+)/g;
|
||||
const realLinkRegex = /https?:\/\/\S+/; // http://anything or https://anything
|
||||
const plainLinkRegex = /((?!https?:\/\/)\S)+\.\S+/; // anything.anything, without http:// or https:// preceding it
|
||||
// Both of the above, with precedence on the first one
|
||||
const urlRegex = new RegExp(`(${realLinkRegex.source}|${plainLinkRegex.source})`, "g");
|
||||
const protocolRegex = /^[a-z]+:\/\//;
|
||||
|
||||
interface MatchedURL extends url.URL {
|
||||
|
|
Loading…
Add table
Reference in a new issue