From 6abd9b68e7e8da7ba0b89572073a67c540182f14 Mon Sep 17 00:00:00 2001 From: reslear <12596485+reslear@users.noreply.github.com> Date: Wed, 19 Nov 2025 02:28:40 +0100 Subject: [PATCH] refactor: add localhost url support --- src/views/struct/value-to-html.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/struct/value-to-html.ts b/src/views/struct/value-to-html.ts index ca8c35e..05e354c 100644 --- a/src/views/struct/value-to-html.ts +++ b/src/views/struct/value-to-html.ts @@ -3,7 +3,7 @@ import { hasOwn, objectToString } from '../../core/utils/object-utils.js'; import { isArray, isError } from '../../core/utils/is-type.js'; import { matchAll } from '../../core/utils/pattern.js'; -const urlRx = /^(?:https?:)?\/\/(?:[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i; +const urlRx = /^(?:https?:)?\/\/(?:localhost|[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i; function token(type: string, str: string | number) { return `${str}`;