Fix textual message stripping new line (#7239)

This commit is contained in:
Renan Cleyson 2021-12-02 06:25:12 -03:00 committed by GitHub
parent 5e77822bcc
commit 0afe141266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 11 deletions

View file

@ -282,6 +282,30 @@ describe("<TextualBody />", () => {
'!ZxbRYPQXDXKGmDnJNg:example.com</a></span> with vias</span>',
);
});
it('renders formatted body without html corretly', () => {
const ev = mkEvent({
type: "m.room.message",
room: "room_id",
user: "sender",
content: {
body: "escaped \\*markdown\\*",
msgtype: "m.text",
format: "org.matrix.custom.html",
formatted_body: "escaped *markdown*",
},
event: true,
});
const wrapper = mount(<TextualBody mxEvent={ev} />);
const content = wrapper.find(".mx_EventTile_body");
expect(content.html()).toBe(
'<span class="mx_EventTile_body" dir="auto">' +
'escaped *markdown*' +
'</span>',
);
});
});
it("renders url previews correctly", () => {