Add body link fallback handler for in-app navigation (#7627)

This commit is contained in:
J. Ryan Stinnett 2022-01-25 14:31:00 +00:00 committed by GitHub
parent 51fd4d82fd
commit fad65f9582
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 11 deletions

View file

@ -21,7 +21,6 @@ import linkifyString from '@matrix-org/linkify-string';
import { RoomMember } from 'matrix-js-sdk/src/models/room-member';
import { registerCustomProtocol, registerPlugin } from '@matrix-org/linkifyjs';
//linkifyjs/src/core/fsm
import { baseUrl } from "./utils/permalinks/MatrixToPermalinkConstructor";
import {
parsePermalink,
@ -227,8 +226,9 @@ export const options = {
if (type === Type.URL) {
try {
const transformed = tryTransformPermalinkToLocalHref(href);
if (transformed !== href || // if it could be converted to handle locally for matrix symbols e.g. @user:server.tdl and matrix.to
decodeURIComponent(href).match(ELEMENT_URL_PATTERN) // for https:vector|riot...
if (
transformed !== href || // if it could be converted to handle locally for matrix symbols e.g. @user:server.tdl and matrix.to
decodeURIComponent(href).match(ELEMENT_URL_PATTERN) // for https links to Element domains
) {
return null;
} else {