diff --git a/src/linkify-matrix.ts b/src/linkify-matrix.ts
index c42d98d326..7935f5d037 100644
--- a/src/linkify-matrix.ts
+++ b/src/linkify-matrix.ts
@@ -225,6 +225,8 @@ export const options = {
rel: 'noreferrer noopener',
},
+ ignoreTags: ['pre', 'code'],
+
className: 'linkified',
target: function(href: string, type: Type | string): string {
diff --git a/test/components/views/messages/TextualBody-test.tsx b/test/components/views/messages/TextualBody-test.tsx
index 371c372196..fe4dbf9946 100644
--- a/test/components/views/messages/TextualBody-test.tsx
+++ b/test/components/views/messages/TextualBody-test.tsx
@@ -216,6 +216,26 @@ describe("
Visit https://matrix.org/
https://matrix.org/\n\n", + }, + event: true, + }); + + const wrapper = getComponent({ mxEvent: ev }, matrixClient); + expect(wrapper.text()).toBe("Visit https://matrix.org/\n1https://matrix.org/\n\n"); + const content = wrapper.find(".mx_EventTile_body"); + expect(content.html()).toMatchSnapshot(); + }); + // If pills were rendered within a Portal/same shadow DOM then it'd be easier to test it("pills get injected correctly into the DOM", () => { const ev = mkEvent({ diff --git a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap index 9d481765e1..15d3b7e208 100644 --- a/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap +++ b/test/components/views/messages/__snapshots__/TextualBody-test.tsx.snap @@ -1,5 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`
Visit https://matrix.org/
1https://matrix.org/
+
@room
1@room