You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Upgrade linkifyjs to fix schemes as domain prefixes (#7628)
This commit is contained in:
@ -278,7 +278,7 @@ describe('linkify-matrix', () => {
|
||||
});
|
||||
|
||||
describe('matrix uri', () => {
|
||||
const AcceptedMatrixUris = [
|
||||
const acceptedMatrixUris = [
|
||||
'matrix:u/foo_bar:server.uk',
|
||||
'matrix:r/foo-bar:server.uk',
|
||||
'matrix:roomid/somewhere:example.org?via=elsewhere.ca',
|
||||
@ -287,7 +287,7 @@ describe('linkify-matrix', () => {
|
||||
'matrix:roomid/somewhere:example.org/e/event?via=elsewhere.ca',
|
||||
'matrix:u/alice:example.org?action=chat',
|
||||
];
|
||||
for (const matrixUri of AcceptedMatrixUris) {
|
||||
for (const matrixUri of acceptedMatrixUris) {
|
||||
it('accepts ' + matrixUri, () => {
|
||||
const test = matrixUri;
|
||||
const found = linkify.find(test);
|
||||
@ -302,4 +302,27 @@ describe('linkify-matrix', () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("matrix-prefixed domains", () => {
|
||||
const acceptedDomains = [
|
||||
'matrix.org',
|
||||
'matrix.to',
|
||||
'matrix-help.org',
|
||||
'matrix123.org',
|
||||
];
|
||||
for (const domain of acceptedDomains) {
|
||||
it('accepts ' + domain, () => {
|
||||
const test = domain;
|
||||
const found = linkify.find(test);
|
||||
expect(found).toEqual(([{
|
||||
href: `http://${domain}`,
|
||||
type: Type.URL,
|
||||
value: domain,
|
||||
end: domain.length,
|
||||
start: 0,
|
||||
isLink: true,
|
||||
}]));
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user