1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Refactor matrix-linkify module (#7279)

Refactor the module to make it easier for upgrade and proper separation of code contexts
This commit is contained in:
Dariusz Niemczyk
2021-12-03 15:00:56 +01:00
committed by GitHub
parent 3b9e39ffca
commit 961fec9081
7 changed files with 99 additions and 206 deletions

View File

@ -13,12 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as linkify from "linkifyjs";
import linkifyMatrix from '../src/linkify-matrix';
beforeAll(() => {
linkifyMatrix(linkify);
});
import { linkify } from '../src/linkify-matrix';
describe('linkify-matrix', () => {
describe('roomalias', () => {
@ -74,7 +69,6 @@ describe('linkify-matrix', () => {
href: "#foo:bar.com",
type: "roomalias",
value: "#foo:bar.com",
}]));
});
it('accept :NUM (port specifier)', () => {
@ -93,7 +87,6 @@ describe('linkify-matrix', () => {
href: "#foo:bar.com",
type: "roomalias",
value: "#foo:bar.com",
}]));
});
it('properly parses room alias with dots in name', () => {
@ -103,7 +96,6 @@ describe('linkify-matrix', () => {
href: "#foo.asdf:bar.com",
type: "roomalias",
value: "#foo.asdf:bar.com",
}]));
});
it('does not parse room alias with too many separators', () => {