From c7f5248bd3c2a14713ed68fd8bce7b08c127fafb Mon Sep 17 00:00:00 2001 From: sha-265 <4103710+sha-265@users.noreply.github.com> Date: Mon, 4 Jul 2022 17:42:49 +0300 Subject: [PATCH 1/5] Add bidirectonal isolation for pills --- src/components/views/elements/Pill.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/views/elements/Pill.tsx b/src/components/views/elements/Pill.tsx index f87e7c020d9..ab5313c210c 100644 --- a/src/components/views/elements/Pill.tsx +++ b/src/components/views/elements/Pill.tsx @@ -256,7 +256,7 @@ export default class Pill extends React.Component { tip = ; } - return + return { this.props.inMessage ? { onClick={onClick} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave} - dir="auto" > { avatar } { linkText } @@ -274,13 +273,12 @@ export default class Pill extends React.Component { className={classes} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave} - dir="auto" > { avatar } { linkText } { tip } } - ; + ; } else { // Deliberately render nothing if the URL isn't recognised return null; From 9f7ec9959b68d80d9edbd279c35459f2826b91e6 Mon Sep 17 00:00:00 2001 From: sha-265 <4103710+sha-265@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:40:36 +0300 Subject: [PATCH 2/5] Fix test --- test/components/views/messages/TextualBody-test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/components/views/messages/TextualBody-test.tsx b/test/components/views/messages/TextualBody-test.tsx index 23c9fa206a0..dbe1fed824b 100644 --- a/test/components/views/messages/TextualBody-test.tsx +++ b/test/components/views/messages/TextualBody-test.tsx @@ -329,13 +329,13 @@ describe("", () => { const content = wrapper.find(".mx_EventTile_body"); expect(content.html()).toBe( '' + - 'A ' + - 'room name with vias', + 'room name with vias', ); }); From bb1bc6df60787e3d27a1d79c827742f745203595 Mon Sep 17 00:00:00 2001 From: sha-265 <4103710+sha-265@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:55:22 +0300 Subject: [PATCH 3/5] Fix test snapshot --- .../views/messages/__snapshots__/TextualBody-test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap index 783f72a697b..5269174153d 100644 --- a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap +++ b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap @@ -14,4 +14,4 @@ exports[` renders formatted m.text correctly pills do not appear " `; -exports[` renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `"Hey \\"\\"Member"`; +exports[` renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `"Hey \\"\\"Member"`; From a6a53c1c0b177f1e8193927e439adf09e66ccd7e Mon Sep 17 00:00:00 2001 From: sha-265 <4103710+sha-265@users.noreply.github.com> Date: Tue, 5 Jul 2022 14:07:52 +0300 Subject: [PATCH 4/5] Fix snapshot --- .../views/messages/__snapshots__/TextualBody-test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap index 5269174153d..7537766df9d 100644 --- a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap +++ b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap @@ -14,4 +14,4 @@ exports[` renders formatted m.text correctly pills do not appear " `; -exports[` renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `"Hey \\"\\"Member"`; +exports[` renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `"Hey \\"\\"Member"`; From e76054cca870222b14434816d89774b6bb590d86 Mon Sep 17 00:00:00 2001 From: sha-265 <4103710+sha-265@users.noreply.github.com> Date: Tue, 5 Jul 2022 14:08:32 +0300 Subject: [PATCH 5/5] Fix test --- test/components/views/messages/TextualBody-test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/views/messages/TextualBody-test.tsx b/test/components/views/messages/TextualBody-test.tsx index dbe1fed824b..d4b1b2aeadf 100644 --- a/test/components/views/messages/TextualBody-test.tsx +++ b/test/components/views/messages/TextualBody-test.tsx @@ -331,7 +331,7 @@ describe("", () => { '' + 'A ' +