diff --git a/src/components/ConfigModal.vue b/src/components/ConfigModal.vue index f8c26d3..965ce74 100644 --- a/src/components/ConfigModal.vue +++ b/src/components/ConfigModal.vue @@ -19,7 +19,7 @@ const config = computed({ const formServers = computed({ get: () => config.value.servers.join(" "), - set: (value) => config.value.servers = (value || "").split(" ").filter(isServer), + set: (value) => config.value.servers = (value || "").replace(/https?:\/\//ig, "").split(/[, ]+/).filter(isServer), }); const tagPattern = /#?([\p{Letter}\p{Number}\p{Mark}\p{Connector_Punctuation}_]+)/igu diff --git a/src/config.ts b/src/config.ts index a00e047..609eae7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -210,7 +210,7 @@ export function isAccount(acc: string) { } export function isServer(server: string) { - return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})$/i) + return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})(:[0-9]{1,5})?$/i) } export function isLanguage(lang: string) {