Fleet UI: More picky regex (Add alternative where must have http and/or www in link) (#13639)
This commit is contained in:
@@ -21,7 +21,7 @@ const ClickableUrls = ({ text, className }: IClickableUrls): JSX.Element => {
|
||||
|
||||
// Regex to find case insensitive URLs and replace with link
|
||||
const replacedLinks = text.replaceAll(
|
||||
/(https?)?(:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/g,
|
||||
/(((https?)?(:\/\/))|((https?)?(:\/\/)?(www\.)))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/g,
|
||||
urlReplacer
|
||||
);
|
||||
const sanitizedResolutionContent = DOMPurify.sanitize(replacedLinks, {
|
||||
|
||||
Reference in New Issue
Block a user