Change mentions regex to support punycode

This commit is contained in:
Crimekillz 2024-05-02 03:01:44 +02:00
parent 295e15205e
commit 16e0cc9471
2 changed files with 3 additions and 2 deletions

View File

@ -96,6 +96,7 @@ import XModalWindow from "@/components/MkModalWindow.vue";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { i18n } from "@/i18n";
import { toASCII } from "punycode/";
const emit = defineEmits<{
(ev: "ok", selected: misskey.entities.UserDetailed): void;
@ -117,7 +118,7 @@ const search = () => {
}
os.api("users/search-by-username-and-host", {
username: username,
host: host,
host: toASCII(host),
limit: 10,
detail: false,
}).then((_users) => {

View File

@ -3,7 +3,7 @@ import getCaretCoordinates from "textarea-caret";
import { toASCII } from "punycode/";
import { popup } from "@/os";
const mentionRegex = /@(?<user>[a-zA-Z0-9_]+|$)@?(?<host>[a-zA-Z0-9-.]+)?$/g;
const mentionRegex = /@(?<user>[a-zA-Z0-9_]+|$)@?(?<host>[\S]+)?$/g;
export class Autocomplete {
private suggestion: {