diff --git a/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPlugin.svelte b/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPlugin.svelte index 1470475a..ffa8042d 100644 --- a/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPlugin.svelte +++ b/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPlugin.svelte @@ -18,7 +18,7 @@ } const URL_REGEX = - /(https?:\/\/)?((\w+:\w+@)?(([a-zA-Z\d]([a-zA-Z\d-]*[a-zA-Z\d])*)\.)+[a-zA-Z]{2,}|localhost|(\d{1,3}\.){3}\d{1,3})(:\d+)?(\/[-a-zA-Z\d%_.~+]*)*(\?[;&a-zA-Z\d%_.~+=-]*)?(#[-a-zA-Z\d_]*)?/; + /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/; const EMAIL_REGEX = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/; diff --git a/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPluginCore.svelte b/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPluginCore.svelte index 8bb9b403..68c00731 100644 --- a/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPluginCore.svelte +++ b/packages/svelte-lexical/src/core/plugins/AutoLink/AutoLinkPluginCore.svelte @@ -46,7 +46,7 @@ return null; } - const PUNCTUATION_OR_SPACE = /[,;\s]/; + const PUNCTUATION_OR_SPACE = /[.,;\s]/; function isSeparator(char: string): boolean { return PUNCTUATION_OR_SPACE.test(char);