Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Support the HTML tags that are sent for message body. Closes #2717

Gabe Kangas4fe42c29deb5
diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss b/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss
index 7d8577e155..e560b17108 100644
--- a/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss
+++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss
@@ -28,6 +28,10 @@
color: var(--theme-color-components-text-on-light);
text-overflow: ellipsis;
line-height: 1.2rem;
+
+ p {
+ margin: 0;
+ }
}
.account {
diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx b/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx
index 28b336d4b4..51c51a9383 100644
--- a/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx
+++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx
@@ -14,7 +14,7 @@ export const Follow = Template.bind({});
Follow.args = {
message: {
type: 'FEDIVERSE_ENGAGEMENT_FOLLOW',
- body: 'james followed this live stream.',
+ body: '<p>james followed this live stream.</p>',
image: 'https://mastodon.social/avatars/original/missing.png',
link: 'https://mastodon.social/@james',
@@ -25,7 +25,7 @@ export const Like = Template.bind({});
Like.args = {
message: {
type: 'FEDIVERSE_ENGAGEMENT_LIKE',
- body: 'james liked that this stream went live.',
+ body: '<p>james liked that this stream went live.</p>',
image: 'https://mastodon.social/avatars/original/missing.png',
link: 'https://mastodon.social/@james',
@@ -36,7 +36,7 @@ export const Repost = Template.bind({});
Repost.args = {
message: {
type: 'FEDIVERSE_ENGAGEMENT_REPOST',
- body: 'james shared this stream with their followers.',
+ body: '<p>james shared this stream with their followers.</p>',
image: 'https://mastodon.social/avatars/original/missing.png',
link: 'https://mastodon.social/@james',
@@ -47,7 +47,7 @@ export const LongAccountName = Template.bind({});
LongAccountName.args = {
message: {
type: 'FEDIVERSE_ENGAGEMENT_REPOST',
- body: 'james shared this stream with their followers.',
+ body: '<p>james shared this stream with their followers.</p>',
image: 'https://mastodon.social/avatars/original/missing.png',
link: 'https://mastodon.social/@james',
@@ -58,7 +58,7 @@ export const InvalidAvatarImage = Template.bind({});
InvalidAvatarImage.args = {
message: {
type: 'FEDIVERSE_ENGAGEMENT_REPOST',
- body: 'james shared this stream with their followers.',
+ body: '<p>james shared this stream with their followers.</p>',
image: 'https://xx.xx/avatars/original/missing.png',
link: 'https://mastodon.social/@james',
diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx b/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx
index 597626dfd4..30ef48e780 100644
--- a/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx
+++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx
@@ -51,7 +51,7 @@ export const ChatSocialMessage: FC<ChatSocialMessageProps> = ({ message }) => {
</Col>
<Col>
<Row className={styles.account}>{title}</Row>
- <Row className={styles.body}>{body}</Row>
+ <Row className={styles.body} dangerouslySetInnerHTML={{ __html: body }} />
</Col>
</Row>
</a>