Handle all permitted url schemes in linkify (#11215)
* Handle all permitted url schemes in linkify * Correctly handle optional slash protocols * Iterate
This commit is contained in:
parent
58710d129d
commit
186497a67d
4 changed files with 57 additions and 30 deletions
|
@ -24,7 +24,7 @@ import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
|
|||
import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls";
|
||||
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
|
||||
|
||||
import { PERMITTED_URL_SCHEMES } from "../HtmlUtils";
|
||||
import { PERMITTED_URL_SCHEMES } from "./UrlUtils";
|
||||
import { makeUserPermalink, RoomPermalinkCreator } from "./permalinks/Permalinks";
|
||||
import { isSelfLocation } from "./location";
|
||||
|
||||
|
|
|
@ -57,3 +57,31 @@ export function parseUrl(u: string): URL {
|
|||
}
|
||||
return new URL(u);
|
||||
}
|
||||
|
||||
export const PERMITTED_URL_SCHEMES = [
|
||||
"bitcoin",
|
||||
"ftp",
|
||||
"geo",
|
||||
"http",
|
||||
"https",
|
||||
"im",
|
||||
"irc",
|
||||
"ircs",
|
||||
"magnet",
|
||||
"mailto",
|
||||
"matrix",
|
||||
"mms",
|
||||
"news",
|
||||
"nntp",
|
||||
"openpgp4fpr",
|
||||
"sip",
|
||||
"sftp",
|
||||
"sms",
|
||||
"smsto",
|
||||
"ssh",
|
||||
"tel",
|
||||
"urn",
|
||||
"webcal",
|
||||
"wtai",
|
||||
"xmpp",
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue