mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 01:39:06 +01:00
Change mentions regex to support punycode
This commit is contained in:
parent
295e15205e
commit
16e0cc9471
@ -96,6 +96,7 @@ import XModalWindow from "@/components/MkModalWindow.vue";
|
|||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
import { toASCII } from "punycode/";
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: "ok", selected: misskey.entities.UserDetailed): void;
|
(ev: "ok", selected: misskey.entities.UserDetailed): void;
|
||||||
@ -117,7 +118,7 @@ const search = () => {
|
|||||||
}
|
}
|
||||||
os.api("users/search-by-username-and-host", {
|
os.api("users/search-by-username-and-host", {
|
||||||
username: username,
|
username: username,
|
||||||
host: host,
|
host: toASCII(host),
|
||||||
limit: 10,
|
limit: 10,
|
||||||
detail: false,
|
detail: false,
|
||||||
}).then((_users) => {
|
}).then((_users) => {
|
||||||
|
@ -3,7 +3,7 @@ import getCaretCoordinates from "textarea-caret";
|
|||||||
import { toASCII } from "punycode/";
|
import { toASCII } from "punycode/";
|
||||||
import { popup } from "@/os";
|
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 {
|
export class Autocomplete {
|
||||||
private suggestion: {
|
private suggestion: {
|
||||||
|
Loading…
Reference in New Issue
Block a user