Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cbd2379

Browse files
authored
Fix formatting of rich text emotes (#12862)
and add them to the new test suite Fixes element-hq/element-web#27896
1 parent 92bf203 commit cbd2379

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

playwright/e2e/messages/messages.spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ test.describe("Message rendering", () => {
6969
await expect(msgTile).toMatchScreenshot(`emote-ltr-${direction}displayname.png`);
7070
});
7171

72+
test("should render an LTR rich text emote", async ({ page, user, app, room }) => {
73+
await page.goto(`#/room/${room.roomId}`);
74+
75+
const msgTile = await sendMessage(page, "/me lays a *free range* egg");
76+
await expect(msgTile).toMatchScreenshot(`emote-rich-ltr-${direction}displayname.png`);
77+
});
78+
7279
test("should render an edited LTR message", async ({ page, user, app, room }) => {
7380
await page.goto(`#/room/${room.roomId}`);
7481

@@ -97,6 +104,13 @@ test.describe("Message rendering", () => {
97104
await expect(msgTile).toMatchScreenshot(`emote-rtl-${direction}displayname.png`);
98105
});
99106

107+
test("should render a richtext RTL emote", async ({ page, user, app, room }) => {
108+
await page.goto(`#/room/${room.roomId}`);
109+
110+
const msgTile = await sendMessage(page, "/me أضع بيضة *حرة النطاق*");
111+
await expect(msgTile).toMatchScreenshot(`emote-rich-rtl-${direction}displayname.png`);
112+
});
113+
100114
test("should render an edited RTL message", async ({ page, user, app, room }) => {
101115
await page.goto(`#/room/${room.roomId}`);
102116

Loading
Loading
Loading
Loading

res/css/views/rooms/_EventTile.pcss

+11
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,17 @@ $left-gutter: 64px;
787787
ul {
788788
list-style-type: disc;
789789
}
790+
791+
/* override styles from the base markdown CSS that put markdown content on its own line,
792+
as this isn't what we want for richtext emote content.
793+
*/
794+
&::before {
795+
display: none;
796+
}
797+
798+
&::after {
799+
display: none;
800+
}
790801
}
791802
}
792803

0 commit comments

Comments
 (0)