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

Commit

Permalink
Fix formatting of rich text emotes
Browse files Browse the repository at this point in the history
and add them to the new test suite

Fixes element-hq/element-web#27896
  • Loading branch information
dbkr committed Aug 5, 2024
1 parent 92bf203 commit a46ae2a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions playwright/e2e/messages/messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ test.describe("Message rendering", () => {
await expect(msgTile).toMatchScreenshot(`emote-ltr-${direction}displayname.png`);
});

test("should render an LTR rich text emote", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`);

const msgTile = await sendMessage(page, "/me lays a *free range* egg");
await expect(msgTile).toMatchScreenshot(`emote-rich-ltr-${direction}displayname.png`);
});

test("should render an edited LTR message", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`);

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

test("should render a richtext RTL emote", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`);

const msgTile = await sendMessage(page, "/me أضع بيضة *حرة النطاق*");
await expect(msgTile).toMatchScreenshot(`emote-rich-rtl-${direction}displayname.png`);
});

test("should render an edited RTL message", async ({ page, user, app, room }) => {
await page.goto(`#/room/${room.roomId}`);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,17 @@ $left-gutter: 64px;
ul {
list-style-type: disc;
}

/* override styles from the base markdown CSS that put markdown content on its own line,
as this isn't what we want for richtext emote content.
*/
&::before {
display: none;
}

&::after {
display: none;
}
}
}

Expand Down

0 comments on commit a46ae2a

Please sign in to comment.