fix: special characters not escaped on sidepanel extended view (#34000)

pull/33851/head^2
Júlia Jaeger Foresti 1 year ago committed by GitHub
parent eb794b7fd6
commit 75643e107c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/tidy-boxes-hide.md
  2. 2
      apps/meteor/client/views/room/Sidepanel/hooks/useItemData.tsx
  3. 3
      apps/meteor/tests/e2e/feature-preview.spec.ts

@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---
Fixes special characters not being escaped on sidepanel extended view

@ -48,7 +48,7 @@ export const useItemData = (
time,
badges,
avatar: AvatarTemplate && <AvatarTemplate {...room} />,
subtitle: message,
subtitle: message ? <span className='message-body--unstyled' dangerouslySetInnerHTML={{ __html: message }} /> : null,
}),
[AvatarTemplate, badges, highlighted, icon, message, openedRoom, room, time],
);

@ -254,8 +254,7 @@ test.describe.serial('feature preview', () => {
await expect(poHomeChannel.sidepanel.getExtendedItem(sidepanelTeam, message)).toBeVisible();
});
// remove .fail after fix
test.fail('should escape special characters on item subtitle', async ({ page }) => {
test('should escape special characters on item subtitle', async ({ page }) => {
await page.goto('/home');
const message = 'hello > world';
const parsedWrong = 'hello &gt; world';

Loading…
Cancel
Save