Fix textual message stripping new line (#7239)
This commit is contained in:
parent
5e77822bcc
commit
0afe141266
2 changed files with 39 additions and 11 deletions
|
@ -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", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue