* fix(frontend): #13089 を修正 * fix * 正規表現を強化 * fix
This commit is contained in:
@@ -9,13 +9,38 @@ import { i18n } from '@/i18n.js';
|
||||
import { popup } from '@/os.js';
|
||||
|
||||
export type OpenOnRemoteOptions = {
|
||||
/**
|
||||
* 外部のMisskey Webで特定のパスを開く
|
||||
*/
|
||||
type: 'web';
|
||||
|
||||
/**
|
||||
* 内部パス(例: `/settings`)
|
||||
*/
|
||||
path: string;
|
||||
} | {
|
||||
/**
|
||||
* 外部のMisskey Webで照会する
|
||||
*/
|
||||
type: 'lookup';
|
||||
path: string;
|
||||
|
||||
/**
|
||||
* 照会したいエンティティのURL
|
||||
*
|
||||
* (例: `https://misskey.example.com/notes/abcdexxxxyz`)
|
||||
*/
|
||||
url: string;
|
||||
} | {
|
||||
/**
|
||||
* 外部のMisskeyでノートする
|
||||
*/
|
||||
type: 'share';
|
||||
|
||||
/**
|
||||
* `/share` ページに渡すクエリストリング
|
||||
*
|
||||
* @see https://go.misskey-hub.net/spec/share/
|
||||
*/
|
||||
params: Record<string, string>;
|
||||
};
|
||||
|
||||
|
@@ -23,6 +23,6 @@ export function appendQuery(url: string, query: string): string {
|
||||
}
|
||||
|
||||
export function extractDomain(url: string) {
|
||||
const match = url.match(/^(https)?:?\/{0,2}([^\/]+)/);
|
||||
return match ? match[2] : null;
|
||||
const match = url.match(/^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?([^:\/\n]+)/im);
|
||||
return match ? match[1] : null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user